私はRubyとTDD(rspec)を同時に学んでいます。
私は次のテストを書きました:
describe is_eligible do
it "returns true if the passed in string is not part of a list" do
result = is_eligible("abc")
result.should eq(false)
end
end
次のコードをテストしています。
def is_eligible(team_name)
array = Array.new
array << "abc" << "def" << "ghi"
if array.include?(team_name)
return false
else
return true
end
end
次のエラーが発生しましたが、理由がわかりません。
* /Users/joel.dehlin/top32/lib/ineligible_teams.rb:6:in `is_eligible':引数の数が間違っています(1の場合は0)(ArgumentError)*
どんな助けでも大歓迎です!