Created
December 3, 2012 00:51
-
-
Save jasonporritt/4191909 to your computer and use it in GitHub Desktop.
motion-stump-doc-snippet
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
# Pure stub objects | |
my_stub = stub(:thing, :return => "dude, a thing!") | |
my_stub.thing # => "dude, a thing!" | |
# Mocking right on the object | |
my_object = "things are fun" | |
my_object.mock!(:fancy, :return => "ooo fancy!") | |
my_object.fancy # => "ooo fancy!" | |
my_object.mock!(:tancy, :return => "ooo fancy!") | |
# if my_object.tancy is not called, it will fail the spec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment