我对 Ruby 相当陌生,对 Rspec 来说是全新的,并且正在尝试使以下 Rspec 代码通过:
require "#{File.dirname(__FILE__)}/fish"
describe fish do
before do
@fish = fish.new(3)
end
it "should report the number of fish" do
@fish.number.should equal 3
end
end
我正在尝试测试以下代码,由于多种原因,我确信这是错误的,但现在我只是试图通过“错误数量的参数(1 代表 0)”错误“:
class fish
def intialize n
@number = n
end
end