diff options
author | Benoit Daloze <[email protected]> | 2021-09-07 19:01:07 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2021-09-07 19:01:07 +0200 |
commit | 258661409e9e3fd470f006975ded872778aad4f4 (patch) | |
tree | 4cd23fe290feb50f4d41349013dbb41bdf12117f /spec/ruby/core/array | |
parent | a375640ea561d1f7c4d2d89839007b3a973a04e0 (diff) |
Update to ruby/spec@b1e93a2
Diffstat (limited to 'spec/ruby/core/array')
-rw-r--r-- | spec/ruby/core/array/intersect_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/ruby/core/array/intersect_spec.rb b/spec/ruby/core/array/intersect_spec.rb new file mode 100644 index 0000000000..b8c5b1e69a --- /dev/null +++ b/spec/ruby/core/array/intersect_spec.rb @@ -0,0 +1,17 @@ +require_relative '../../spec_helper' + +describe 'Array#intersect?' do + ruby_version_is '3.1' do # https://bugs.ruby-lang.org/issues/15198 + describe 'when at least one element in two Arrays is the same' do + it 'returns true' do + [1, 2].intersect?([2, 3]).should == true + end + end + + describe 'when there are no elements in common between two Arrays' do + it 'returns false' do + [1, 2].intersect?([3, 4]).should == false + end + end + end +end |