public
Description: RSpec-style specification for the Ruby programming language
Homepage: http://rubyspec.org
Clone URL: git://github.com/brixen/rubyspec.git
cleanup of Hash#clear specs
gramos (author)
Mon May 19 22:59:18 -0700 2008
NoKarma (committer)
Tue May 20 06:43:00 -0700 2008
commit  864e8ef23a6faf00c4da36372853bbeba37b6b34
tree    8791c2e12f1544983eea8948fe44edec4b6c7fe8
parent  55624eb03c5ac308dce7cb733cc5b50857f99f20
...
8
9
10
11
 
12
13
14
15
 
 
 
 
 
 
 
16
17
18
...
8
9
10
 
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
0
@@ -8,11 +8,18 @@ describe "Hash#clear" do
0
     h.should == {}
0
   end
0
 
0
-  it "does not remove default values and procs" do
0
+  it "does not remove default values" do
0
     h = Hash.new(5)
0
     h.clear
0
     h.default.should == 5
0
 
0
+    h = { "a" => 100, "b" => 200 }
0
+    h.default = "Go fish"
0
+    h.clear
0
+    h["z"].should == "Go fish"
0
+  end
0
+
0
+  it "does not remove default procs" do
0
     h = Hash.new { 5 }
0
     h.clear
0
     h.default_proc.should_not == nil

Comments