Module: FlexMock::ArgumentTypes

Included in:
FlexMock, MockContainerHelper, Recorder, TestCase, Test::Unit::TestCase
Defined in:
lib/gems/flexmock-0.8.3/lib/flexmock/argument_types.rb

Overview

Include this module in your test class if you wish to use the eq and any argument matching methods without a prefix. (Otherwise use FlexMock.any and FlexMock.eq(obj).

Instance Method Summary collapse

Instance Method Details

#anyObject

Return an argument matcher that matches any argument.



23
24
25
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/argument_types.rb', line 23

def any
  ANY
end

#eq(obj) ⇒ Object

Return an argument matcher that only matches things equal to (==) the given object.



29
30
31
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/argument_types.rb', line 29

def eq(obj)
  EqualMatcher.new(obj)
end

#on(&block) ⇒ Object

Return an argument matcher that matches any object, that when passed to the supplied block, will cause the block to return true.



36
37
38
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/argument_types.rb', line 36

def on(&block)
  ProcMatcher.new(&block)
end