.exactly(:thrice) should raise ArgumentError
Reported by MatthewRudy | June 5th, 2008 @ 06:48 PM | in No-Milestone-Assigned
Encountered this when guessing that :thrice may work like :twice
@mock.should_receive(:random_call).exactly(:thrice)
1)
ArgumentError in 'Search.do should call process 3 times'
comparison of Fixnum with nil failed
spec/models/search_spec.rb:5:
namely, the error is hardly verbose,
and it took me a while to realise that it was the spec that was broken, rather that something else.
the attached diff fixes this by simply raising an argument erorr if not provided a Numeric, :once or :twice.
1)
ArgumentError in 'Search.do should call process 3 times'
ArgumentError
spec/spec/mocks/at_least_spec.rb:98:
spec/spec/mocks/at_least_spec.rb:5:
Luckily this makes the error come from the correct line.
Comments and changes to this ticket
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Behaviour Driven Development for Ruby.
