test/support/custom_assertions.rb
def parsed_json(json)
    if json.is_a? Hash
      json
    else
      JSON.parse( json.to_s )
    end
  end
#
#  Fails unless +json contains string +key.
#
Fails unless +json contains string +key.
Fails unless + json contains string + key .
def parsed_json(json)
    if json.is_a? Hash
      json
    else
      JSON.parse( json.to_s )
    end
  end
def parsed_json ( json ) if json . is_a? Hash json else JSON . parse ( json . to_s ) end end
Fails unless +json contains string +key.
Fails unless + json contains string + key .
json