Skip to content

Commit d2a3723

Browse files
committed
Fixed ambiguous first argument warning in ArrayExtTest.
1 parent 1b38705 commit d2a3723

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

activesupport/test/core_ext/array_ext_test.rb

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def to_param
2121
"#{self}1"
2222
end
2323
end
24-
24+
2525
def test_string_array
2626
assert_equal '', %w().to_param
2727
assert_equal 'hello/world', %w(hello world).to_param
@@ -31,7 +31,7 @@ def test_string_array
3131
def test_number_array
3232
assert_equal '10/20', [10, 20].to_param
3333
end
34-
34+
3535
def test_to_param_array
3636
assert_equal 'custom1/param1', [ToParam.new('custom'), ToParam.new('param')].to_param
3737
end
@@ -222,10 +222,10 @@ def test_to_xml_with_block
222222

223223
assert xml.include?(%(<count>2</count>)), xml
224224
end
225-
225+
226226
def test_to_xml_with_empty
227227
xml = [].to_xml
228-
assert_match /type="array"\/>/, xml
228+
assert_match(/type="array"\/>/, xml)
229229
end
230230
end
231231

@@ -239,17 +239,15 @@ def test_extract_options
239239
end
240240

241241
uses_mocha "ArrayExtRandomTests" do
242+
class ArrayExtRandomTests < Test::Unit::TestCase
243+
def test_random_element_from_array
244+
assert_nil [].rand
242245

243-
class ArrayExtRandomTests < Test::Unit::TestCase
244-
def test_random_element_from_array
245-
assert_nil [].rand
246-
247-
Kernel.expects(:rand).with(1).returns(0)
248-
assert_equal 'x', ['x'].rand
246+
Kernel.expects(:rand).with(1).returns(0)
247+
assert_equal 'x', ['x'].rand
249248

250-
Kernel.expects(:rand).with(3).returns(1)
251-
assert_equal 2, [1, 2, 3].rand
249+
Kernel.expects(:rand).with(3).returns(1)
250+
assert_equal 2, [1, 2, 3].rand
251+
end
252252
end
253253
end
254-
255-
end

0 commit comments

Comments
 (0)