diff options
Diffstat (limited to 'spec/support/delayed_should_receive.rb')
-rw-r--r-- | spec/support/delayed_should_receive.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/delayed_should_receive.rb b/spec/support/delayed_should_receive.rb new file mode 100644 index 0000000..c3a333e --- /dev/null +++ b/spec/support/delayed_should_receive.rb @@ -0,0 +1,11 @@ +class Object + def should_receive_delayed(method, *args) + m = Spec::Mocks::Mock.new('proxy') + if args.empty? + m.should_receive(method) + else + m.should_receive(method).with(*args) + end + self.should_receive(:delay).and_return(m) + end +end |