Class: Oktest::JsonMatcher::Length

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

Instance Method Summary collapse

Constructor Details

#initialize(expected) ⇒ Length

Returns a new instance of Length.



810
811
812
# File 'lib/oktest.rb', line 810

def initialize(expected)
  @expected = expected
end

Instance Method Details

#===(actual) ⇒ Object



813
814
815
816
# File 'lib/oktest.rb', line 813

def ===(actual)
  #; [!03ozi] compares length of actual value with expected value.
  return @expected === actual.length
end

#inspectObject



817
818
819
820
# File 'lib/oktest.rb', line 817

def inspect()
  #; [!nwv3e] returns 'Length(n)' string.
  return "Length(#{@expected.inspect})"
end