class Muack::Modifier
Public Instance Methods
object()
click to toggle source
Public API
# File lib/muack/modifier.rb, line 48 def object mock.object end
peek_args(opts={})
click to toggle source
Public API
# File lib/muack/modifier.rb, line 36 def peek_args opts={}, &block defi.peek_args = create_block(block, opts) self end
peek_return(opts={})
click to toggle source
Public API
# File lib/muack/modifier.rb, line 42 def peek_return opts={}, &block defi.peek_return = create_block(block, opts) self end
returns(opts={})
click to toggle source
Public API
# File lib/muack/modifier.rb, line 30 def returns opts={}, &block defi.returns = create_block(block, opts) self end
times(number)
click to toggle source
# File lib/muack/modifier.rb, line 8 def times number if mock.__mock_class == Stub raise StubHasNoTimes.new(object, defi, number) end if number >= 1 (number - 1).times{ mock.__mock_defis_push(defi) } elsif number == 0 mock.__mock_defis_pop(defi) else raise "What would you expect from calling a method #{number} times?" end self end
with_any_args()
click to toggle source
Public API
# File lib/muack/modifier.rb, line 24 def with_any_args defi.args = [WithAnyArgs] self end
Private Instance Methods
create_block(block, opts)
click to toggle source
# File lib/muack/modifier.rb, line 53 def create_block block, opts if opts[:instance_exec] then Block.new(block) else block end end