module Minitest::MatchJson
JSON matchers
JSON matchers
Constants
- VERSION
Attributes
configuration[W]
Public Class Methods
compare_json(actual_json, expected_json)
click to toggle source
# File lib/minitest/match_json.rb, line 21 def compare_json(actual_json, expected_json) Diffy::Diff.new( expected_json, actual_json, context: configuration.context ).to_s(configuration.format) end
configuration()
click to toggle source
# File lib/minitest/match_json.rb, line 13 def configuration @configuration ||= Configuration.new end
configure() { |configuration| ... }
click to toggle source
# File lib/minitest/match_json.rb, line 17 def configure yield configuration end
pretty_json(param)
click to toggle source
# File lib/minitest/match_json.rb, line 29 def pretty_json(param) json = (param.is_a?(String)) ? param : param.to_json JSON.pretty_generate(JSON.parse(json)) end