module FlexMock::ArgumentTypes
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)
.
Public Instance Methods
Source
# File lib/flexmock/argument_types.rb, line 22 def any ANY end
Return an argument matcher that matches any argument.
Source
# File lib/flexmock/argument_types.rb, line 47 def ducktype(*methods) DuckMatcher.new(methods) end
Return an argument matcher that matches any object that implementes (i.e. responds to) the given method list.
Source
# File lib/flexmock/argument_types.rb, line 28 def eq(obj) EqualMatcher.new(obj) end
Return an argument matcher that only matches things equal to (==) the given object.
Source
# File lib/flexmock/argument_types.rb, line 41 def hsh(hash) HashMatcher.new(hash) end
Return an argument matcher that matches a hash with the given entries.
Source
# File lib/flexmock/argument_types.rb, line 35 def on(&block) ProcMatcher.new(&block) end
Return an argument matcher that matches any object, that when passed to the supplied block, will cause the block to return true.