shash 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/shash.rb +5 -1
- data/lib/version.rb +1 -1
- data/test/test_shash.rb +14 -1
- metadata +1 -1
data/lib/shash.rb
CHANGED
data/lib/version.rb
CHANGED
data/test/test_shash.rb
CHANGED
@@ -24,10 +24,23 @@ describe Shash do
|
|
24
24
|
h.should == {"y"=>{"z"=>0}}.to_shash
|
25
25
|
end
|
26
26
|
|
27
|
-
it "#
|
27
|
+
it "#has_key? should check for key existence correctly" do
|
28
28
|
h = {"a"=>1, "b"=>{"c"=>2}}.to_shash
|
29
29
|
h.has_key?("z").should == false
|
30
30
|
h.has_key?("b").should == true
|
31
31
|
h.b.has_key?("c").should == true
|
32
32
|
end
|
33
|
+
|
34
|
+
it "#[] should still works as expected" do
|
35
|
+
h = {"a"=>1}.to_shash
|
36
|
+
h.a.should == 1
|
37
|
+
h["a"].should == 1
|
38
|
+
end
|
39
|
+
|
40
|
+
it "#[]= should still works as expected" do
|
41
|
+
h = Shash.new
|
42
|
+
h["b"] = 2
|
43
|
+
h.b.should == 2
|
44
|
+
end
|
45
|
+
|
33
46
|
end
|