lib/stump/mock.rb in motion-stump-0.2.0 vs lib/stump/mock.rb in motion-stump-0.2.1

- old
+ new

@@ -21,16 +21,28 @@ raise ArgumentError if block.arity >= 0 && args.length != block.arity Stump::Mocks.verify([self, method]) block.call(*args) end + elsif options[:yield] + lambda do |*args| + Stump::Mocks.verify([self, method]) + yield(options[:yield]) + end else lambda do |*args| Stump::Mocks.verify([self, method]) return options[:return] end end + meta_def method, &behavior + end + + def should_not_call(method) + behavior = lambda do |*args| + should.flunk "Umet expectations: #{method} expected to not be called" + end meta_def method, &behavior end end module Kernel