Sha256: 4a2d0aa90bfe81834208e5d99acd7e8bf0d1118c2f18cbd2e05b1cb3accc32a1

Contents?: true

Size: 962 Bytes

Versions: 3

Compression:

Stored size: 962 Bytes

Contents

require 'minitest/autorun'
require 'minitest/reporters'
Minitest::Reporters.use! Minitest::Reporters::DefaultReporter.new

require 'roar/representer'
require 'roar/json'
require 'roar/json/json_api'

require 'representable/debug'
require 'pp'

require_relative 'jsonapi/representer'

require 'json_spec/configuration'
require 'json_spec/helpers'
require 'json_spec/exclusion'

if system('colordiff', __FILE__, __FILE__)
  MiniTest::Assertions.diff = 'colordiff -u'
end

module JsonSpec
  extend Configuration

  self.excluded_keys = []
end
module MiniTest::Assertions
  def assert_equal_json(actual, expected)
    assert_equal scrub(actual), scrub(expected)
  end

  def scrub(json, path = nil)
    JsonSpec::Helpers.generate_normalized_json(
      JsonSpec::Exclusion.exclude_keys(
        JsonSpec::Helpers.parse_json(json, path)
      )
    ).chomp + "\n"
  end
end
module Minitest::Expectations
  infect_an_assertion :assert_equal_json, :must_equal_json
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
roar-jsonapi-0.0.3 test/test_helper.rb
roar-jsonapi-0.0.2 test/test_helper.rb
roar-jsonapi-0.0.1 test/test_helper.rb