aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'site/spec/support/delayed_should_receive.rb')
-rw-r--r--site/spec/support/delayed_should_receive.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/site/spec/support/delayed_should_receive.rb b/site/spec/support/delayed_should_receive.rb
new file mode 100644
index 0000000..0fbbe27
--- /dev/null
+++ b/site/spec/support/delayed_should_receive.rb
@@ -0,0 +1,11 @@
+class Object
+ def should_receive_delayed(method, *args)
+ m = RSpec::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