lib/pact/something_like.rb in pact-1.0.9 vs lib/pact/something_like.rb in pact-1.0.10

- old
+ new

@@ -1,8 +1,14 @@ +require 'pact/symbolize_keys' module Pact + # Specifies that the actual object should be considered a match if + # it includes the same keys, and the values of the keys are of the same class. + class SomethingLike + include SymbolizeKeys + attr_reader :contents def initialize contents @contents = contents end @@ -17,10 +23,10 @@ def to_json opts = {} as_json.to_json opts end def self.json_create hash - new(hash['contents']) + new(symbolize_keys(hash)) end def generate contents end