Skip to content

Instantly share code, notes, and snippets.

@farnoy
Created March 10, 2012 19:13
Show Gist options
  • Select an option

  • Save farnoy/2012572 to your computer and use it in GitHub Desktop.

Select an option

Save farnoy/2012572 to your computer and use it in GitHub Desktop.
flexmock(User).should_receive(:find).with('42').and_return(jane) # Flexmock
User.should_receive(:find).with('42').and_return(jane) # Rspec
User.expects(:find).with('42').returns {jane} # Mocha
User.should_receive(:find).with('42') {jane} # Rspec using return value blocks
mock(User).find('42') {jane} # RR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment