Created
June 20, 2012 18:18
-
-
Save jimweirich/2961375 to your computer and use it in GitHub Desktop.
Isolating Class Changes
This file contains 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
context "with an isolated decorator class" do | |
let(:decorator_class) { Class.new(Decorator) } | |
subject{ decorator_class.new(source) } | |
context "when #hello_world is called again" do | |
it "proxies method directly after first hit" do | |
subject.methods.should_not include(:hello_world) | |
subject.hello_world | |
subject.methods.should include(:hello_world) | |
end | |
end | |
context "when #hello_world is called for the first time" do | |
it "hits method missing" do | |
subject.should_receive(:method_missing) | |
subject.hello_world | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment