Skip to content

Instantly share code, notes, and snippets.

@jasonporritt
Created December 3, 2012 00:51
Show Gist options
  • Save jasonporritt/4191909 to your computer and use it in GitHub Desktop.
Save jasonporritt/4191909 to your computer and use it in GitHub Desktop.
motion-stump-doc-snippet
# 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