Class: FlexMock::ProcMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/flexmock/argument_matchers.rb

Overview

Match only things where the block evaluates to true.

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ ProcMatcher

Returns a new instance of ProcMatcher.



45
46
47
# File 'lib/flexmock/argument_matchers.rb', line 45

def initialize(&block)
  @block = block
end

Instance Method Details

#===(target) ⇒ Object



48
49
50
# File 'lib/flexmock/argument_matchers.rb', line 48

def ===(target)
  @block.call(target)
end

#inspectObject



51
52
53
# File 'lib/flexmock/argument_matchers.rb', line 51

def inspect
  "on{...}"
end