Displaying 2 results from an estimated 2 matches for "define_expected_method".
2008 Jun 12
0
Mysterious interaction between RSpec 1.1.4 and has_finder/named_scope
...39;'SpaceFile be readable''
You have a nil object when you didn''t expect it!
The error occurred while evaluating nil.call
/Users/rick/near-time/near-time.net-exp-migrate-to-rspec-1-1-4-6750/spec/models/space_file_spec.rb:12:
What''s happening is when Spec::Mocks::Proxy.define_expected_method uses
class_eval to define the stub method, Ruby is calling public under the
covers but instead of getting the standard method which makes the method
public, it ends up calling the method generated by the named_scope method
which tries to get a proc from an empty hash, and ends up trying to send
cal...
2006 Oct 23
6
overriding mock expectations
There is one annoyance I''m encountering with the Mock API in rSpec.
Overall it works well, as far as dynamic mocks go ;)... but there''s
this one thing... It doesn''t allow overriding of expectations.
example:
m = mock("blah")
m.should_receive(:one).any_number_of_times().and_return(1)
m.should_receive(:one).and_return(1)
The second call to should_receive