aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2015-03-01 19:05:47 -0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2015-03-01 19:05:47 -0800
commitfc91616a4e6c953c419cccbce2ec7a3e1c0e3941 (patch)
tree52b368ecc24bde879cedaebf75783d4192b83d3a /activesupport/test/core_ext
parent3a156ec8e79b88ff90e8f5ed34dd05b89e94b72f (diff)
parentc7a37c10ade8372c712be01a7e4ddbe8785c5139 (diff)
downloadrails-fc91616a4e6c953c419cccbce2ec7a3e1c0e3941.tar.gz
rails-fc91616a4e6c953c419cccbce2ec7a3e1c0e3941.tar.bz2
rails-fc91616a4e6c953c419cccbce2ec7a3e1c0e3941.zip
Merge pull request #19157 from todd/enumerable_without
Add Enumerable#without
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r--activesupport/test/core_ext/enumerable_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb
index 346dc3d208..e5d8ae7882 100644
--- a/activesupport/test/core_ext/enumerable_test.rb
+++ b/activesupport/test/core_ext/enumerable_test.rb
@@ -103,4 +103,11 @@ class EnumerableTests < ActiveSupport::TestCase
assert_equal true, GenericEnumerable.new([ 1 ]).exclude?(2)
assert_equal false, GenericEnumerable.new([ 1 ]).exclude?(1)
end
+
+ def test_without
+ assert_equal [1, 2, 4], GenericEnumerable.new((1..5).to_a).without(3, 5)
+ assert_equal [1, 2, 4], (1..5).to_a.without(3, 5)
+ assert_equal [1, 2, 4], (1..5).to_set.without(3, 5)
+ assert_equal({foo: 1, baz: 3}, {foo: 1, bar: 2, baz: 3}.without(:bar))
+ end
end