casted_hash 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e6fa74a70ab96f305134d7b76f0d09054ab63c8
4
- data.tar.gz: 015673c797ef268dcc33ead39faf55f5346c9d08
3
+ metadata.gz: 20f5d3ca34ab88a7b6456373f515b26493d47d77
4
+ data.tar.gz: ffe8dbdbcff47b7113471a73dfd9148d2db6aaa9
5
5
  SHA512:
6
- metadata.gz: 12c4c6f1b92d71bcb7c333897fc3ec927e4bc4a7358daff4f85478939b397c638ac939af45a996cb797877f44149d209df983c0e11e71cb6af72d2ac47a8fb69
7
- data.tar.gz: d7b405bb10596a467c404f0e3891f2af86a5c4b384056a5b3e5aed2b2803d91c65927ecb82e3798404093df0ce055f1fac9432b14aa3a3f24602f96672a2860d
6
+ metadata.gz: 6541f82e40508c13111f9456f811efc3a7d6fea2d5ba53a90e0993f852f82f9d99bcb90aebd93d2eddbb4e77f396d5e5ca45389ca22db9ad0326988df9ca8426
7
+ data.tar.gz: f9be5b96e77e4a465609a27016888fa14c7a520c48d858895d96833bc0fa7f56bf5a5f8f0e113dac6533f194fe502bf077f09d1f9f6ecf478fec7d570a0f0ed2
@@ -1,3 +1,3 @@
1
1
  class CastedHash
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/casted_hash.rb CHANGED
@@ -72,7 +72,7 @@ class CastedHash
72
72
  end
73
73
 
74
74
  def update(other_hash)
75
- return unless other_hash.any?
75
+ return self if other_hash.empty?
76
76
 
77
77
  if other_hash.is_a? CastedHash
78
78
  @hash.update other_hash.pack_hash(self)
@@ -95,6 +95,8 @@ class TestCastedHash < Minitest::Test
95
95
 
96
96
  assert_equal 13, hash[:a]
97
97
  assert_equal 12, hash[:b]
98
+
99
+ assert_equal hash, hash.merge({})
98
100
  end
99
101
 
100
102
  it "should take over scope when merging two casted hashes" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: casted_hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephan Kaag