Class: Spec::Mocks::LiteralArgConstraint

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

Instance Method Summary collapse

Constructor Details

#initialize(literal) ⇒ LiteralArgConstraint

Returns a new instance of LiteralArgConstraint.



15
16
17
# File 'lib/spec/mocks/argument_expectation.rb', line 15

def initialize(literal)
  @literal_value = literal
end

Instance Method Details

#matches?(value) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/spec/mocks/argument_expectation.rb', line 19

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