Skip to content

Commit 0a256b2

Browse files
committed
Fix wording and only specify the behavior when it was actually defined for Hash#reject.
1 parent c0c086e commit 0a256b2

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

spec/ruby/core/hash/reject_spec.rb

+11-9
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ def h.to_a() end
2525
h.reject { false }.to_a.should == [[1, 2]]
2626
end
2727

28-
ruby_bug "extra states should not be copied", "2.1" do
29-
it "returns Hash instance for subclasses" do
30-
HashSpecs::MyHash[1 => 2, 3 => 4].reject { false }.should be_kind_of(Hash)
31-
HashSpecs::MyHash[1 => 2, 3 => 4].reject { true }.should be_kind_of(Hash)
32-
end
33-
34-
it "taints the resulting hash" do
35-
h = new_hash(:a => 1).taint
36-
h.reject {false}.tainted?.should == false
28+
ruby_version_is "2.2" do
29+
context "with extra state" do
30+
it "returns Hash instance for subclasses" do
31+
HashSpecs::MyHash[1 => 2, 3 => 4].reject { false }.should be_kind_of(Hash)
32+
HashSpecs::MyHash[1 => 2, 3 => 4].reject { true }.should be_kind_of(Hash)
33+
end
34+
35+
it "does not taint the resulting hash" do
36+
h = new_hash(:a => 1).taint
37+
h.reject {false}.tainted?.should == false
38+
end
3739
end
3840
end
3941

0 commit comments

Comments
 (0)