Class: Spec::Api::LiteralArgConstraint

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

Instance Method Summary collapse

Constructor Details

#initialize(literal) ⇒ LiteralArgConstraint

Returns a new instance of LiteralArgConstraint.



5
6
7
# File 'lib/spec/api/mocks/argument_expectation.rb', line 5

def initialize(literal)
  @literal_value = literal
end

Instance Method Details

#matches?(value) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/spec/api/mocks/argument_expectation.rb', line 9

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