diff -uNr deep_merge-1.0.1.ORIG/deep_merge.gemspec deep_merge-1.0.1/deep_merge.gemspec
--- deep_merge-1.0.1.ORIG/deep_merge.gemspec 2014-05-30 13:15:45.024000000 +0000
+++ deep_merge-1.0.1/deep_merge.gemspec 2014-05-30 13:18:42.221000000 +0000
@@ -30,5 +30,6 @@
else
s.add_dependency(%q<rake>, ["~> 10.1"])
end
+ s.add_development_dependency "minitest"
end
diff -uNr deep_merge-1.0.1.ORIG/test/test_deep_merge.rb deep_merge-1.0.1/test/test_deep_merge.rb
--- deep_merge-1.0.1.ORIG/test/test_deep_merge.rb 2014-05-30 13:15:45.024000000 +0000
+++ deep_merge-1.0.1/test/test_deep_merge.rb 2014-05-30 13:21:27.440000000 +0000
@@ -1,4 +1,4 @@
-require 'test/unit'
+require 'minitest/autorun'
$:.unshift(File.dirname(__FILE__) + '/../lib/')
require 'deep_merge'
@@ -11,7 +11,7 @@
end
end
-class TestDeepMerge < Test::Unit::TestCase
+class TestDeepMerge < Minitest::Test
def setup
end
@@ -214,12 +214,13 @@
assert_equal({"property" => {"bedroom_count" => {"king_bed" => [nil, 3], "queen_bed" => [4, nil, 1]}, "bathroom_count" => [nil, "2", "1"]}}, hash_dst)
# test parameter management for knockout_prefix and overwrite unmergable
- assert_raise(DeepMerge::InvalidParameter) {DeepMerge::deep_merge!(hash_src, hash_dst, {:knockout_prefix => ""})}
- assert_raise(DeepMerge::InvalidParameter) {DeepMerge::deep_merge!(hash_src, hash_dst, {:preserve_unmergeables => true, :knockout_prefix => ""})}
- assert_raise(DeepMerge::InvalidParameter) {DeepMerge::deep_merge!(hash_src, hash_dst, {:preserve_unmergeables => true, :knockout_prefix => "--"})}
- assert_nothing_raised(DeepMerge::InvalidParameter) {DeepMerge::deep_merge!(hash_src, hash_dst, {:knockout_prefix => "--"})}
- assert_nothing_raised(DeepMerge::InvalidParameter) {DeepMerge::deep_merge!(hash_src, hash_dst)}
- assert_nothing_raised(DeepMerge::InvalidParameter) {DeepMerge::deep_merge!(hash_src, hash_dst, {:preserve_unmergeables => true})}
+ assert_raises(DeepMerge::InvalidParameter) {DeepMerge::deep_merge!(hash_src, hash_dst, {:knockout_prefix => ""})}
+ assert_raises(DeepMerge::InvalidParameter) {DeepMerge::deep_merge!(hash_src, hash_dst, {:preserve_unmergeables => true, :knockout_prefix => ""})}
+ assert_raises(DeepMerge::InvalidParameter) {DeepMerge::deep_merge!(hash_src, hash_dst, {:preserve_unmergeables => true, :knockout_prefix => "--"})}
+ # test valid parameters
+ DeepMerge::deep_merge!(hash_src, hash_dst, {:knockout_prefix => "--"})
+ DeepMerge::deep_merge!(hash_src, hash_dst)
+ DeepMerge::deep_merge!(hash_src, hash_dst, {:preserve_unmergeables => true})
# hash holding arrays of arrays
hash_src = {["1", "2", "3"] => ["1", "2"]}