We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce3a887 commit f1aeeb4Copy full SHA for f1aeeb4
lib/dwolla_v2/super_hash.rb
@@ -6,7 +6,7 @@ class SuperHash < Hash
6
include Hashie::Extensions::DeepFetch
7
8
def == other
9
- super(other) || super(self.class[other])
+ super(other) || other && super(self.class[other])
10
end
11
12
spec/dwolla_v2/super_hash_spec.rb
@@ -22,4 +22,10 @@
22
super_hash = DwollaV2::Util.deep_super_hasherize(hash)
23
expect(super_hash).to eq hash
24
25
+
26
+ it "== works with nil values" do
27
+ hash = { a: { b: { c: "d" } } }
28
+ super_hash = DwollaV2::Util.deep_super_hasherize(hash)
29
+ expect(super_hash).not_to eq nil
30
+ end
31
0 commit comments