diff options
Diffstat (limited to 'activesupport/test/core_ext/array_ext_test.rb')
-rw-r--r-- | activesupport/test/core_ext/array_ext_test.rb | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/activesupport/test/core_ext/array_ext_test.rb b/activesupport/test/core_ext/array_ext_test.rb index 62a1f61d53..01b243cdb5 100644 --- a/activesupport/test/core_ext/array_ext_test.rb +++ b/activesupport/test/core_ext/array_ext_test.rb @@ -15,17 +15,13 @@ class ArrayExtAccessTests < Test::Unit::TestCase end def test_second_through_tenth - array = (1..10).to_a + array = (1..42).to_a assert_equal array[1], array.second assert_equal array[2], array.third assert_equal array[3], array.fourth assert_equal array[4], array.fifth - assert_equal array[5], array.sixth - assert_equal array[6], array.seventh - assert_equal array[7], array.eighth - assert_equal array[8], array.ninth - assert_equal array[9], array.tenth + assert_equal array[41], array.forty_two end end @@ -294,16 +290,14 @@ class ArrayExtractOptionsTests < Test::Unit::TestCase end end -uses_mocha "ArrayExtRandomTests" do - class ArrayExtRandomTests < Test::Unit::TestCase - def test_random_element_from_array - assert_nil [].rand +class ArrayExtRandomTests < Test::Unit::TestCase + def test_random_element_from_array + assert_nil [].rand - Kernel.expects(:rand).with(1).returns(0) - assert_equal 'x', ['x'].rand + Kernel.expects(:rand).with(1).returns(0) + assert_equal 'x', ['x'].rand - Kernel.expects(:rand).with(3).returns(1) - assert_equal 2, [1, 2, 3].rand - end + Kernel.expects(:rand).with(3).returns(1) + assert_equal 2, [1, 2, 3].rand end end |