Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions test/babelish/test_android2csv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,24 @@ def test_special_chars
# clean up
system("rm -rf ./" + csv_filename)
end

def test_cdata_are_not_removed
csv_filename = "./test.csv"
filename = "test/data/android_cdata.xml"
headers = %w{variables german}

expected_output = [["html"], {filename => {"html" => "<![CDATA[<p>Text<p>]]>"}}]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inside { missing.
Space inside } missing.

converter = Babelish::Android2CSV.new(
:csv_filename => csv_filename,
:headers => headers,
:filenames => [filename])

output = converter.convert(false)

assert File.exist?(converter.csv_filename)
assert_equal expected_output, output

# clean up
system("rm -rf ./" + csv_filename)
end
end
4 changes: 4 additions & 0 deletions test/data/android_cdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="html"><![CDATA[<p>Text<p>]]></string>
</resources>