diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-06-03 13:35:03 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-06-03 13:35:03 -0500 |
commit | a977f3e88e989cd7d795c46504451b4b1b4db79d (patch) | |
tree | 8bef0972e5bc1d989b86770560567d5ab2bae7f5 | |
parent | c08547d2266c75f0a82d06dd91c6d0500740e12e (diff) | |
download | rails-a977f3e88e989cd7d795c46504451b4b1b4db79d.tar.gz rails-a977f3e88e989cd7d795c46504451b4b1b4db79d.tar.bz2 rails-a977f3e88e989cd7d795c46504451b4b1b4db79d.zip |
Fixed ambiguous first argument warning in ArrayExtTest.
-rw-r--r-- | activesupport/test/core_ext/array_ext_test.rb | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/activesupport/test/core_ext/array_ext_test.rb b/activesupport/test/core_ext/array_ext_test.rb index 20bc5dfcb7..73fbeb8b6b 100644 --- a/activesupport/test/core_ext/array_ext_test.rb +++ b/activesupport/test/core_ext/array_ext_test.rb @@ -21,7 +21,7 @@ class ArrayExtToParamTests < Test::Unit::TestCase "#{self}1" end end - + def test_string_array assert_equal '', %w().to_param assert_equal 'hello/world', %w(hello world).to_param @@ -31,7 +31,7 @@ class ArrayExtToParamTests < Test::Unit::TestCase def test_number_array assert_equal '10/20', [10, 20].to_param end - + def test_to_param_array assert_equal 'custom1/param1', [ToParam.new('custom'), ToParam.new('param')].to_param end @@ -222,10 +222,10 @@ class ArrayToXmlTests < Test::Unit::TestCase assert xml.include?(%(<count>2</count>)), xml end - + def test_to_xml_with_empty xml = [].to_xml - assert_match /type="array"\/>/, xml + assert_match(/type="array"\/>/, xml) end end @@ -239,17 +239,15 @@ class ArrayExtractOptionsTests < Test::Unit::TestCase 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 + Kernel.expects(:rand).with(3).returns(1) + assert_equal 2, [1, 2, 3].rand + end end end - -end |