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.0.0.rc1 test/test_helper_test.rb
representable-1.8.5 test/test_helper_test.rb
representable-1.8.4 test/test_helper_test.rb
representable-1.8.3 test/test_helper_test.rb
representable-1.8.2 test/test_helper_test.rb
representable-1.8.1 test/test_helper_test.rb
representable-1.8.0 test/test_helper_test.rb
representable-1.7.7 test/test_helper_test.rb
representable-1.7.6 test/test_helper_test.rb
representable-1.7.5 test/test_helper_test.rb
representable-1.7.4 test/test_helper_test.rb
representable-1.7.3 test/test_helper_test.rb
representable-1.7.2 test/test_helper_test.rb
representable-1.7.1 test/test_helper_test.rb
representable-1.7.0 test/test_helper_test.rb
representable-1.6.1 test/test_helper_test.rb
representable-1.6.0 test/test_helper_test.rb
representable-1.5.3 test/test_helper_test.rb
representable-1.5.2 test/test_helper_test.rb
representable-1.5.1 test/test_helper_test.rb