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.



797
798
799
# File 'lib/oktest.rb', line 797

def initialize(expected)
  @expected = expected
end

Instance Method Details

#===(actual) ⇒ Object



800
801
802
803
# File 'lib/oktest.rb', line 800

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

#inspectObject



804
805
806
807
# File 'lib/oktest.rb', line 804

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