-
-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
at_least(:once) doesn't work as documented #40
Comments
Allow users to specify return values by passing a block to #at_least, #at_most and #exactly.
Each of the above now work but previously returned nothing since the block was discarded. Closed by 0f09860. |
Thanks for reporting this bug! It's fixed in master now. |
Glad I did, thanks for fast response! |
myronmarston
added a commit
to myronmarston/rspec-mocks
that referenced
this issue
Oct 21, 2012
… #at_most and #exactly. - @mock.should_receive(:to_s).at_least(:once) { "return val" } - @mock.should_receive(:to_s).at_most(:once) { "return val" } - @mock.should_receive(:to_s).exactly(:once) { "return val" } Each of the above now work but previously returned nothing since the block was discarded. Closes rspec#40.
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example:
@obj = Object.new
@obj.should_receive(:to_s).at_least(:once) {"testing"}
@obj.to_s.should == "testing"
Upper test fails. It works if I modify the expectation line like that, but doesn't read right:
@obj.should_receive(:to_s).at_least(:once).times {"testing"}
The text was updated successfully, but these errors were encountered: