aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorGabriel Sobrinho <gabriel.sobrinho@gmail.com>2019-03-06 11:16:07 -0300
committerGabriel Sobrinho <gabriel.sobrinho@gmail.com>2019-03-06 13:34:04 -0300
commit87468284d523d5e760445633666232840777e312 (patch)
tree260ad601d42222edc9e715056ac44f5e6a42fefa /activesupport/test
parentb366be3b5b28f01c8a55d67a5161ec36f53d555c (diff)
downloadrails-87468284d523d5e760445633666232840777e312.tar.gz
rails-87468284d523d5e760445633666232840777e312.tar.bz2
rails-87468284d523d5e760445633666232840777e312.zip
Fix including/excluding flattening
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/array/access_test.rb2
-rw-r--r--activesupport/test/core_ext/enumerable_test.rb1
2 files changed, 3 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/array/access_test.rb b/activesupport/test/core_ext/array/access_test.rb
index 8f89c3f25c..427b058925 100644
--- a/activesupport/test/core_ext/array/access_test.rb
+++ b/activesupport/test/core_ext/array/access_test.rb
@@ -35,11 +35,13 @@ class AccessTest < ActiveSupport::TestCase
def test_including
assert_equal [1, 2, 3, 4, 5], [1, 2, 4].including(3, 5).sort
assert_equal [1, 2, 3, 4, 5], [1, 2, 4].including([3, 5]).sort
+ assert_equal [[0, 1], [1, 0]], [[0, 1]].including([[1, 0]])
end
def test_excluding
assert_equal [1, 2, 4], [1, 2, 3, 4, 5].excluding(3, 5)
assert_equal [1, 2, 4], [1, 2, 3, 4, 5].excluding([3, 5])
+ assert_equal [[0, 1]], [[0, 1], [1, 0]].excluding([[1, 0]])
end
def test_without
diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb
index 4e9cf3848d..381b5a1f32 100644
--- a/activesupport/test/core_ext/enumerable_test.rb
+++ b/activesupport/test/core_ext/enumerable_test.rb
@@ -220,6 +220,7 @@ class EnumerableTests < ActiveSupport::TestCase
def test_excluding
assert_equal [1, 2, 4], GenericEnumerable.new((1..5).to_a).excluding(3, 5)
assert_equal [3, 4, 5], GenericEnumerable.new((1..5).to_a).excluding([1, 2])
+ assert_equal [[0, 1]], GenericEnumerable.new([[0, 1], [1, 0]]).excluding([[1, 0]])
assert_equal [1, 2, 4], (1..5).to_a.excluding(3, 5)
assert_equal [1, 2, 4], (1..5).to_set.excluding(3, 5)
assert_equal({ foo: 1, baz: 3 }, { foo: 1, bar: 2, baz: 3 }.excluding(:bar))