Class: Spec::Mocks::BooleanArgConstraint

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/mocks/argument_expectation.rb

Instance Method Summary collapse

Constructor Details

#initialize(ignore) ⇒ BooleanArgConstraint

Returns a new instance of BooleanArgConstraint.



75
76
# File 'lib/spec/mocks/argument_expectation.rb', line 75

def initialize(ignore)
end

Instance Method Details

#==(value) ⇒ Object



78
79
80
# File 'lib/spec/mocks/argument_expectation.rb', line 78

def ==(value)
  matches?(value)
end

#matches?(value) ⇒ Boolean

Returns:

  • (Boolean)


82
83
84
85
86
# File 'lib/spec/mocks/argument_expectation.rb', line 82

def matches?(value)
  return true if value.is_a?(TrueClass)
  return true if value.is_a?(FalseClass)
  false
end