Class: EqualJson
- Inherits:
-
Object
- Object
- EqualJson
- Defined in:
- lib/eq_json.rb
Instance Attribute Summary collapse
-
#actual ⇒ Object
Returns the value of attribute actual.
-
#currentActualObj ⇒ Object
Returns the value of attribute currentActualObj.
-
#currentExpectedObj ⇒ Object
Returns the value of attribute currentExpectedObj.
-
#currentJsonKey ⇒ Object
Returns the value of attribute currentJsonKey.
-
#expected ⇒ Object
Returns the value of attribute expected.
-
#jsonPath ⇒ Object
Returns the value of attribute jsonPath.
-
#jsonPathRoot ⇒ Object
Returns the value of attribute jsonPathRoot.
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(expected) ⇒ EqualJson
constructor
A new instance of EqualJson.
- #matches?(actual) ⇒ Boolean
Constructor Details
#initialize(expected) ⇒ EqualJson
Returns a new instance of EqualJson.
11 12 13 14 15 16 |
# File 'lib/eq_json.rb', line 11 def initialize(expected) @expected = expected @jsonPathRoot = "$." @jsonPath = @jsonPathRoot = EqJsonMessageGenerator.new(self) end |
Instance Attribute Details
#actual ⇒ Object
Returns the value of attribute actual.
8 9 10 |
# File 'lib/eq_json.rb', line 8 def actual @actual end |
#currentActualObj ⇒ Object
Returns the value of attribute currentActualObj.
8 9 10 |
# File 'lib/eq_json.rb', line 8 def currentActualObj @currentActualObj end |
#currentExpectedObj ⇒ Object
Returns the value of attribute currentExpectedObj.
8 9 10 |
# File 'lib/eq_json.rb', line 8 def currentExpectedObj @currentExpectedObj end |
#currentJsonKey ⇒ Object
Returns the value of attribute currentJsonKey.
8 9 10 |
# File 'lib/eq_json.rb', line 8 def currentJsonKey @currentJsonKey end |
#expected ⇒ Object
Returns the value of attribute expected.
8 9 10 |
# File 'lib/eq_json.rb', line 8 def expected @expected end |
#jsonPath ⇒ Object
Returns the value of attribute jsonPath.
8 9 10 |
# File 'lib/eq_json.rb', line 8 def jsonPath @jsonPath end |
#jsonPathRoot ⇒ Object
Returns the value of attribute jsonPathRoot.
8 9 10 |
# File 'lib/eq_json.rb', line 8 def jsonPathRoot @jsonPathRoot end |
Instance Method Details
#description ⇒ Object
38 39 40 |
# File 'lib/eq_json.rb', line 38 def description "Excpect {@expected}" end |
#failure_message ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/eq_json.rb', line 24 def if RSpec.configuration.methods.include? :json_debug_config if RSpec.configuration.json_debug_config? debugDumper = EqJsonDebugDumper.new(self) debugDumper.dump() end end return @failureMessage end |
#failure_message_when_negated ⇒ Object
34 35 36 |
# File 'lib/eq_json.rb', line 34 def "Expeced failure_message_when_nagated" end |
#matches?(actual) ⇒ Boolean
18 19 20 21 22 |
# File 'lib/eq_json.rb', line 18 def matches?(actual) @actual = actual matchesObject?(@expected, @actual) end |