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-1.5.0 test/test_helper_test.rb
representable-1.4.2 test/test_helper_test.rb
representable-1.4.1 test/test_helper_test.rb
representable-1.4.0 test/test_helper_test.rb
representable-1.3.5 test/test_helper_test.rb
representable-1.3.4 test/test_helper_test.rb
representable-1.3.3 test/test_helper_test.rb
representable-1.3.2 test/test_helper_test.rb
representable-1.3.1 test/test_helper_test.rb
representable-1.3.0 test/test_helper_test.rb
representable-1.2.9 test/test_helper_test.rb
representable-1.2.8 test/test_helper_test.rb
representable-1.2.7 test/test_helper_test.rb
representable-1.2.6 test/test_helper_test.rb
representable-1.2.5 test/test_helper_test.rb
representable-1.2.4 test/test_helper_test.rb