Created
May 29, 2013 10:44
-
-
Save fnando/5669437 to your computer and use it in GitHub Desktop.
RSpec 2.14.0.rc1 introduces message expectation through the expect method. To be honest, I still prefer the classic syntax in this case, since it's easier to format the code in multiple lines (readability <3).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Classic syntax | |
| some_object | |
| .should_receive(:some_method) | |
| .with(:a, :b, :c) | |
| .and_return(:d) | |
| # expect syntax | |
| expect(some_object).to receive(:some_method).with(:a, :b, :c).and_return(:d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment