Skip to content

Commit

Permalink
Fix odd build order stuff.
Browse files Browse the repository at this point in the history
These two tests test the same thing, and it's really hard to tear down the global state of 'added a method dynamically to a class.'
  • Loading branch information
steveklabnik committed Jun 20, 2012
1 parent 04324c9 commit 3dc206b
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions spec/draper/base_spec.rb
Expand Up @@ -712,20 +712,10 @@ class DecoratorWithDeniesAndAllows < Draper::Base
end

describe "#method_missing" do
context "when #hello_world is called for the first time" do
subject{ Decorator.new(source) }
it "hits method missing" do
subject.should_receive(:method_missing)
subject.hello_world
end
end

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
it "proxies method directly" do
subject.methods.should_not include(:hello_world)
subject.hello_world
subject.methods.should include(:hello_world)
end

context "when the delegated method calls a non-existant method" do
Expand Down

0 comments on commit 3dc206b

Please sign in to comment.