Created
August 1, 2012 15:06
-
-
Save kyamaguchi/3227620 to your computer and use it in GitHub Desktop.
RSpec stub
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
| # Default | |
| Hoge.any_instance.stub(:save).and_return(false) | |
| Hoge.any_instance.should_receive(:update_attributes).with({'these' => 'params'}) | |
| # mocha | |
| Hoge.any_instance.stubs(:save).returns(false) | |
| Hoge.any_instance.expects(:update_attributes).with({'these' => 'params'}) | |
| # spec_helper for mocha | |
| RSpec.configure do |config| | |
| config.mock_with :mocha |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment