Skip subclass spec with SortedSet

This commit is contained in:
Hiroshi SHIBATA 2020-12-04 19:36:30 +09:00
parent b06ffce4ae
commit e666bd1c5a
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -7,11 +7,13 @@ describe "Enumerable#to_set" do
{a: 1, b: 2}.to_set.should == Set[[:b, 2], [:a, 1]] {a: 1, b: 2}.to_set.should == Set[[:b, 2], [:a, 1]]
end end
ruby_version_is ''...'3.0' do
it "allows passing an alternate class for Set" do it "allows passing an alternate class for Set" do
sorted_set = [1, 2, 3].to_set(SortedSet) sorted_set = [1, 2, 3].to_set(SortedSet)
sorted_set.should == SortedSet[1, 2, 3] sorted_set.should == SortedSet[1, 2, 3]
sorted_set.instance_of?(SortedSet).should == true sorted_set.instance_of?(SortedSet).should == true
end end
end
it "passes down passed blocks" do it "passes down passed blocks" do
[1, 2, 3].to_set { |x| x * x }.should == Set[1, 4, 9] [1, 2, 3].to_set { |x| x * x }.should == Set[1, 4, 9]