diff options
Diffstat (limited to 'spec/ruby/library/set/sortedset/delete_spec.rb')
-rw-r--r-- | spec/ruby/library/set/sortedset/delete_spec.rb | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/spec/ruby/library/set/sortedset/delete_spec.rb b/spec/ruby/library/set/sortedset/delete_spec.rb index 71583c7f13..0e2a6accf3 100644 --- a/spec/ruby/library/set/sortedset/delete_spec.rb +++ b/spec/ruby/library/set/sortedset/delete_spec.rb @@ -1,37 +1,40 @@ require_relative '../../../spec_helper' -require 'set' -describe "SortedSet#delete" do - before :each do - @set = SortedSet["a", "b", "c"] - end +ruby_version_is ""..."3.0" do + require 'set' - it "deletes the passed Object from self" do - @set.delete("a") - @set.should_not include("a") - end + describe "SortedSet#delete" do + before :each do + @set = SortedSet["a", "b", "c"] + end - it "returns self" do - @set.delete("a").should equal(@set) - @set.delete("x").should equal(@set) - end -end + it "deletes the passed Object from self" do + @set.delete("a") + @set.should_not include("a") + end -describe "SortedSet#delete?" do - before :each do - @set = SortedSet["a", "b", "c"] + it "returns self" do + @set.delete("a").should equal(@set) + @set.delete("x").should equal(@set) + end end - it "deletes the passed Object from self" do - @set.delete?("a") - @set.should_not include("a") - end + describe "SortedSet#delete?" do + before :each do + @set = SortedSet["a", "b", "c"] + end - it "returns self when the passed Object is in self" do - @set.delete?("a").should equal(@set) - end + it "deletes the passed Object from self" do + @set.delete?("a") + @set.should_not include("a") + end + + it "returns self when the passed Object is in self" do + @set.delete?("a").should equal(@set) + end - it "returns nil when the passed Object is not in self" do - @set.delete?("x").should be_nil + it "returns nil when the passed Object is not in self" do + @set.delete?("x").should be_nil + end end end |