Skip to content

Commit

Permalink
Set 1.1 now checks subclass-ness stricter
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Dec 23, 2023
1 parent f6e9899 commit dc7785e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
8 changes: 5 additions & 3 deletions spec/ruby/library/set/flatten_spec.rb
Expand Up @@ -45,9 +45,11 @@
-> { set.flatten! }.should raise_error(ArgumentError)
end

context "when Set contains a Set-like object" do
it "flattens self, including Set-like objects" do
Set[SetSpecs::SetLike.new([1])].flatten!.should == Set[1]
version_is(Set::VERSION, ""..."1.1.0") do
context "when Set contains a Set-like object" do
it "flattens self, including Set-like objects" do
Set[SetSpecs::SetLike.new([1])].flatten!.should == Set[1]
end
end
end
end
8 changes: 5 additions & 3 deletions spec/ruby/library/set/proper_subset_spec.rb
Expand Up @@ -33,9 +33,11 @@
-> { Set[].proper_subset?(Object.new) }.should raise_error(ArgumentError)
end

context "when comparing to a Set-like object" do
it "returns true if passed a Set-like object that self is a proper subset of" do
Set[1, 2, 3].proper_subset?(SetSpecs::SetLike.new([1, 2, 3, 4])).should be_true
version_is(Set::VERSION, ""..."1.1.0") do
context "when comparing to a Set-like object" do
it "returns true if passed a Set-like object that self is a proper subset of" do
Set[1, 2, 3].proper_subset?(SetSpecs::SetLike.new([1, 2, 3, 4])).should be_true
end
end
end
end
8 changes: 5 additions & 3 deletions spec/ruby/library/set/subset_spec.rb
Expand Up @@ -33,9 +33,11 @@
-> { Set[].subset?(Object.new) }.should raise_error(ArgumentError)
end

context "when comparing to a Set-like object" do
it "returns true if passed a Set-like object that self is a subset of" do
Set[1, 2, 3].subset?(SetSpecs::SetLike.new([1, 2, 3, 4])).should be_true
version_is(Set::VERSION, ""..."1.1.0") do
context "when comparing to a Set-like object" do
it "returns true if passed a Set-like object that self is a subset of" do
Set[1, 2, 3].subset?(SetSpecs::SetLike.new([1, 2, 3, 4])).should be_true
end
end
end
end

1 comment on commit dc7785e

@eregon
Copy link
Member

@eregon eregon commented on dc7785e Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @ivoanjo

Please sign in to comment.