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

any() click to toggle source

Return an argument matcher that matches any argument.

# File lib/flexmock/argument_types.rb, line 23
def any
  ANY
end
ducktype(*methods) click to toggle source

Return an argument matcher that matches any object that implementes (i.e. responds to) the given method list.

# File lib/flexmock/argument_types.rb, line 48
def ducktype(*methods)
  DuckMatcher.new(methods)
end
eq(obj) click to toggle source

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

# File lib/flexmock/argument_types.rb, line 29
def eq(obj)
  EqualMatcher.new(obj)
end
hsh(hash) click to toggle source

Return an argument matcher that matches a hash with the given entries.

# File lib/flexmock/argument_types.rb, line 42
def hsh(hash)
  HashMatcher.new(hash)
end
on(&block) click to toggle source

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

# File lib/flexmock/argument_types.rb, line 36
def on(&block)
  ProcMatcher.new(&block)
end
optional_proc() click to toggle source
# File lib/flexmock/argument_types.rb, line 52
def optional_proc
  OPTIONAL_PROC_MATCHER
end