Skip to content

Commit

Permalink
Add missing test case for Array#intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
andrykonchin committed Jan 18, 2023
1 parent a8d1da1 commit a6d0386
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/ruby/core/array/shared/intersection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
end

it "creates an array with elements in order they are first encountered" do
[ 1, 2, 3, 2, 5 ].send(@method, [ 5, 2, 3, 4 ]).should == [2, 3, 5]
[ 1, 2, 3, 2, 5, 6, 7, 8 ].send(@method, [ 5, 2, 3, 4 ]).should == [2, 3, 5] # array > other
[ 5, 2, 3, 4 ].send(@method, [ 1, 2, 3, 2, 5, 6, 7, 8 ]).should == [5, 2, 3] # array < other
end

it "does not modify the original Array" do
Expand Down

0 comments on commit a6d0386

Please sign in to comment.