@@ -21,7 +21,7 @@ def to_param
21
21
"#{ self } 1"
22
22
end
23
23
end
24
-
24
+
25
25
def test_string_array
26
26
assert_equal '' , %w( ) . to_param
27
27
assert_equal 'hello/world' , %w( hello world ) . to_param
@@ -31,7 +31,7 @@ def test_string_array
31
31
def test_number_array
32
32
assert_equal '10/20' , [ 10 , 20 ] . to_param
33
33
end
34
-
34
+
35
35
def test_to_param_array
36
36
assert_equal 'custom1/param1' , [ ToParam . new ( 'custom' ) , ToParam . new ( 'param' ) ] . to_param
37
37
end
@@ -222,10 +222,10 @@ def test_to_xml_with_block
222
222
223
223
assert xml . include? ( %(<count>2</count>) ) , xml
224
224
end
225
-
225
+
226
226
def test_to_xml_with_empty
227
227
xml = [ ] . to_xml
228
- assert_match /type="array"\/ >/ , xml
228
+ assert_match ( /type="array"\/ >/ , xml )
229
229
end
230
230
end
231
231
@@ -239,17 +239,15 @@ def test_extract_options
239
239
end
240
240
241
241
uses_mocha "ArrayExtRandomTests" do
242
+ class ArrayExtRandomTests < Test ::Unit ::TestCase
243
+ def test_random_element_from_array
244
+ assert_nil [ ] . rand
242
245
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
249
248
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
252
252
end
253
253
end
254
-
255
- end
0 commit comments