Created
September 20, 2011 05:06
-
-
Save zealoushacker/1228374 to your computer and use it in GitHub Desktop.
RSpec shorthand for YourClass.stub(:your_method).and_return(true)
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
| require 'spec_helper' | |
| describe YourClass do | |
| describe "some functionality that depends on YourClass::your_method" do | |
| # YourClass.stub(:your_method).and_return(true) is equivalent to: | |
| YourClass.stub(:your_method) { true } | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment