Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Forked from pat/gist:1947369
Created March 4, 2012 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myronmarston/1975201 to your computer and use it in GitHub Desktop.
Save myronmarston/1975201 to your computer and use it in GitHub Desktop.
Using rspec-fire?
# My normal approach:
require './path/to/my_class'
describe MyClass do
let(:my_class) { MyClass.new }
describe '#add_widget' do
it "makes a widget using OtherClass" do
other_class = fire_replaced_class_double("OtherClass")
other_class.should_receive(:make_widget!)
my_class.add_widget
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment