0

I'm going through the Test-First-Ruby exercises, but I've hit an error that seems like a bug:

Failures:

1) add adds 0 and 0 Failure/Error: add(0,0).should == 0 NoMethodError: undefined method add' for #<RSpec::Core::ExampleGroup::Nested_1:0x007fdd890bab08> # ./spec/02_calculator.rb:42:inblock (2 levels) in '

I understand it can't find the 'add' method, but here's what my /test-first-ruby/lib/02_calculator.rb file looks like:

def add(num1,num2)
  new_num = num1 + num2
end

I don't understand what I'm doing wrong.

Justin Wood
  • 9,941
  • 2
  • 33
  • 46
  • Are you including your calculator file in your test file? – Justin Wood Aug 22 '14 at 22:13
  • 2
    You need to supply more information, the source of your spec, the source of your calculator, the names of the directories they're in. Otherwise all we can tell you is your spec can't see your method, which you already know. – Nick Veys Aug 22 '14 at 22:19

0 Answers0