should_receive on a Simple Delegator fails with " bind argument must be an instance of Object"
Created by: MattRogish
Ruby 1.9.3p327, rspec-mocks-2.12.2
it "fails" do
class Foo < SimpleDelegator
def happy
end
end
Foo.any_instance.should_receive(:happy)
bar = Foo.new(1)
bar.happy
end
You get:
Failure/Error: bar.happy
TypeError:
bind argument must be an instance of Object