Skip to content

Instantly share code, notes, and snippets.

@zealoushacker
Created September 20, 2011 05:06
Show Gist options
  • Select an option

  • Save zealoushacker/1228374 to your computer and use it in GitHub Desktop.

Select an option

Save zealoushacker/1228374 to your computer and use it in GitHub Desktop.
RSpec shorthand for YourClass.stub(:your_method).and_return(true)
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