-
-
Save myronmarston/1975201 to your computer and use it in GitHub Desktop.
Using rspec-fire?
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
# 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