diff options
author | Vasiliy Ermolovich <younash@gmail.com> | 2011-12-21 17:31:40 +0300 |
---|---|---|
committer | Vasiliy Ermolovich <younash@gmail.com> | 2011-12-21 17:31:40 +0300 |
commit | c52ce1dae2ca8b72732f92c84541a4b6bbc9da77 (patch) | |
tree | ba4cc3bf5620c847489495f102f7174e557be375 /activesupport/test | |
parent | 618cb4429191290b957391c314a55b4d59f381f3 (diff) | |
download | rails-c52ce1dae2ca8b72732f92c84541a4b6bbc9da77.tar.gz rails-c52ce1dae2ca8b72732f92c84541a4b6bbc9da77.tar.bz2 rails-c52ce1dae2ca8b72732f92c84541a4b6bbc9da77.zip |
remove Array#sample from core_ext
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/array_ext_test.rb | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/activesupport/test/core_ext/array_ext_test.rb b/activesupport/test/core_ext/array_ext_test.rb index 52231aaeb0..6739b4afbd 100644 --- a/activesupport/test/core_ext/array_ext_test.rb +++ b/activesupport/test/core_ext/array_ext_test.rb @@ -363,34 +363,6 @@ class ArrayUniqByTests < Test::Unit::TestCase end end -class ArrayExtRandomTests < ActiveSupport::TestCase - def test_sample_from_array - assert_nil [].sample - assert_equal [], [].sample(5) - assert_equal 42, [42].sample - assert_equal [42], [42].sample(5) - - a = [:foo, :bar, 42] - s = a.sample(2) - assert_equal 2, s.size - assert_equal 1, (a-s).size - assert_equal [], a-(0..20).sum{a.sample(2)} - - o = Object.new - def o.to_int; 1; end - assert_equal [0], [0].sample(o) - - o = Object.new - assert_raises(TypeError) { [0].sample(o) } - - o = Object.new - def o.to_int; ''; end - assert_raises(TypeError) { [0].sample(o) } - - assert_raises(ArgumentError) { [0].sample(-7) } - end -end - class ArrayWrapperTests < Test::Unit::TestCase class FakeCollection def to_ary |