Class: Pact::Matchers::TypeDifference

Inherits:
BaseDifference show all
Defined in:
lib/pact/matchers/type_difference.rb

Instance Attribute Summary

Attributes inherited from BaseDifference

#actual, #expected, #message

Instance Method Summary collapse

Methods inherited from BaseDifference

#==, #any?, #empty?, #initialize, #to_json, #to_s

Constructor Details

This class inherits a constructor from Pact::Matchers::BaseDifference

Instance Method Details

#as_json(options = {}) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/pact/matchers/type_difference.rb', line 7

def as_json options = {}
  if KeyNotFound === actual
    {:EXPECTED_TYPE => expected.as_json, :ACTUAL => actual.as_json }
  else
    {:EXPECTED_TYPE => expected.as_json, :ACTUAL_TYPE => actual.as_json }
  end
end