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
representable-2.4.0.rc1 test/test_helper_test.rb
representable-2.3.0 test/test_helper_test.rb
representable-2.2.3 test/test_helper_test.rb
representable-2.2.2 test/test_helper_test.rb
representable-2.2.1 test/test_helper_test.rb
representable-2.2.0 test/test_helper_test.rb
representable-2.1.8 test/test_helper_test.rb
representable-2.1.7 test/test_helper_test.rb
representable-2.1.6 test/test_helper_test.rb
representable-2.1.5 test/test_helper_test.rb
representable-2.1.4 test/test_helper_test.rb
representable-2.1.3 test/test_helper_test.rb
representable-2.1.1 test/test_helper_test.rb
representable-2.1.0 test/test_helper_test.rb
representable-2.0.4 test/test_helper_test.rb
representable-2.0.3 test/test_helper_test.rb
representable-2.0.2 test/test_helper_test.rb
representable-2.0.1 test/test_helper_test.rb
representable-2.0.0 test/test_helper_test.rb
representable-2.0.0.rc2 test/test_helper_test.rb