Permalink
Browse files

Fixed ambiguous first argument warning in ArrayExtTest.

  • Loading branch information...
1 parent 1b38705 commit d2a3723b089656aae280716a839becc5ab9e9092 @josh josh committed Jun 3, 2008
Showing with 12 additions and 14 deletions.
  1. +12 −14 activesupport/test/core_ext/array_ext_test.rb
@@ -21,7 +21,7 @@ def to_param
"#{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 @@ def test_string_array
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 @@ def test_to_xml_with_block
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 @@ def test_extract_options
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

0 comments on commit d2a3723

Please sign in to comment.