Sha256: 5a35a8365c5feafc9cc432a7a748a0df7d6120ab9fcddd463014b2bee59f5ad4

Contents?: true

Size: 872 Bytes

Versions: 76

Compression:

Stored size: 872 Bytes

Contents

require 'test_helper'

class TestHelperTest < MiniTest::Spec
  describe "#assert_json" do
    it "tests for equality" do
      assert_json "{\"songs\":{\"one\":\"65\",\"two\":\"Emo Boy\"}}", "{\"songs\":{\"one\":\"65\",\"two\":\"Emo Boy\"}}"
    end
    
    it "allows different key orders" do
      assert_json "{\"songs\":{\"one\":\"65\",\"two\":\"Emo Boy\"}}", "{\"songs\":{\"two\":\"Emo Boy\",\"one\":\"65\"}}"
    end
    
    it "complains when expected hash is subset" do
      assert_raises MiniTest::Assertion do
        assert_json "{\"songs\":{\"one\":\"65\"}}", "{\"songs\":{\"two\":\"Emo Boy\",\"one\":\"65\"}}"
      end
    end
    
    it "complains when source hash is subset" do
      assert_raises MiniTest::Assertion do
        assert_json "{\"songs\":{\"two\":\"Emo Boy\",\"one\":\"65\"}}", "{\"songs\":{\"one\":\"65\"}}"
      end
    end
  end
end

Version data entries

76 entries across 72 versions & 3 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/representable-3.2.0/test/test_helper_test.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/representable-3.2.0/test/test_helper_test.rb
representable-3.2.0 test/test_helper_test.rb
representable-3.1.1 test/test_helper_test.rb
representable-3.1.0 test/test_helper_test.rb
representable-3.0.4 test/test_helper_test.rb
representable-3.0.3 test/test_helper_test.rb
representable-3.0.2 test/test_helper_test.rb
representable-3.0.1 test/test_helper_test.rb
representable-3.0.0 test/test_helper_test.rb
representable-2.4.1 test-with-deprecations/test_helper_test.rb
representable-2.4.1 test/test_helper_test.rb
representable-2.4.0 test-with-deprecations/test_helper_test.rb
representable-2.4.0 test/test_helper_test.rb
representable-2.4.0.rc5 test/test_helper_test.rb
representable-2.4.0.rc5 test-with-deprecations/test_helper_test.rb
representable-2.4.0.rc4 test/test_helper_test.rb
representable-2.4.0.rc4 test-with-deprecations/test_helper_test.rb
representable-2.4.0.rc3 test/test_helper_test.rb
representable-2.4.0.rc2 test/test_helper_test.rb