Commit 2a0a8d6d authored by Samuel Giddins's avatar Samuel Giddins

[InfoPlist] Properly format serialized arrays

Adds a newline after the </array> tag
parent 43082b28
......@@ -88,7 +88,7 @@ module Pod
when Array
output << indent << "<array>\n"
value.each { |v| serialize(v, output, indentation + 2) }
output << indent << '</array>'
output << indent << "</array>\n"
when Hash
output << indent << "<dict>\n"
value.to_a.sort_by(&:first).each do |key, v|
......
......@@ -85,6 +85,23 @@ module Pod
Xcodeproj::Plist.read_from_path(file)['UIRequiredDeviceCapabilities'].should == %w(arm64)
end
it 'properly formats serialized arrays' do
generator = Generator::InfoPlistFile.new(mock('Target'))
generator.send(:to_plist, 'array' => %w(a b)).should == <<-PLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>array</key>
<array>
<string>a</string>
<string>b</string>
</array>
</dict>
</plist>
PLIST
end
it 'uses the specified bundle_package_type' do
target = mock('Target', :platform => stub(:name => :ios))
generator = Generator::InfoPlistFile.new(target, :bundle_package_type => :bndl)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment