Skip to content

Commit

Permalink
Merge pull request #1194 from herwinw/set_merge_ruby_3_3
Browse files Browse the repository at this point in the history
Test multiple arguments in Set#merge
  • Loading branch information
andrykonchin authored Sep 24, 2024
2 parents ae05448 + eb796b0 commit 9341c0a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions library/set/merge_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,16 @@
-> { Set[1, 2].merge(1) }.should raise_error(ArgumentError)
-> { Set[1, 2].merge(Object.new) }.should raise_error(ArgumentError)
end

ruby_version_is ""..."3.3" do
it "accepts only a single argument" do
-> { Set[].merge([], []) }.should raise_error(ArgumentError, "wrong number of arguments (given 2, expected 1)")
end
end

ruby_version_is "3.3" do
it "accepts multiple arguments" do
Set[:a, :b].merge(Set[:b, :c], [:d]).should == Set[:a, :b, :c, :d]
end
end
end

0 comments on commit 9341c0a

Please sign in to comment.