aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/array_ext_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext/array_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/array_ext_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/array_ext_test.rb b/activesupport/test/core_ext/array_ext_test.rb
index 957c56c92d..709df84f06 100644
--- a/activesupport/test/core_ext/array_ext_test.rb
+++ b/activesupport/test/core_ext/array_ext_test.rb
@@ -169,4 +169,14 @@ class ArrayToXmlTests < Test::Unit::TestCase
assert xml.include?(%(<street-address>Paulina</street-address>))
assert xml.include?(%(<street-address>Evergreen</street-address>))
end
+
+ def test_to_with_instruct
+ xml = [
+ { :name => "David", :age => 26, :age_in_millis => 820497600000 },
+ { :name => "Jason", :age => 31, :age_in_millis => BigDecimal.new('1.0') }
+ ].to_xml(:skip_instruct => false, :indent => 0)
+
+ assert /^<\?xml [^>]*/.match(xml)
+ assert xml.rindex(/<\?xml /) == 0
+ end
end