diff options
author | Todd Bealmear <todd@t0dd.io> | 2015-03-01 17:44:36 -0800 |
---|---|---|
committer | Todd Bealmear <todd@t0dd.io> | 2015-03-01 18:45:45 -0800 |
commit | c7a37c10ade8372c712be01a7e4ddbe8785c5139 (patch) | |
tree | 7252f20da29c87cc4d04f0363e530fc8d510a5b1 /activesupport/test/core_ext | |
parent | e1e2b54e853a9b405f10bab110c28064164a7469 (diff) | |
download | rails-c7a37c10ade8372c712be01a7e4ddbe8785c5139.tar.gz rails-c7a37c10ade8372c712be01a7e4ddbe8785c5139.tar.bz2 rails-c7a37c10ade8372c712be01a7e4ddbe8785c5139.zip |
Add Enumerable#without
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/enumerable_test.rb | 7 |
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 |