-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try Fix CDATA problem in android2csv.rb #104
base: master
Are you sure you want to change the base?
Changes from all commits
6ac906d
c7bdf9d
ea498e8
9863f90
f66672a
e1284d5
005cf5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
*~ | ||
*# | ||
#*# | ||
.DS_Store | ||
|
||
# Config file | ||
.babelish | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,4 +50,23 @@ 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>]]>"}}] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space inside { missing. |
||
converter = Babelish::Android2CSV.new( | ||
:csv_filename => csv_filename, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the new Ruby 1.9 hash syntax. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the new Ruby 1.9 hash syntax. |
||
:headers => headers, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the new Ruby 1.9 hash syntax. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the new Ruby 1.9 hash syntax. |
||
:filenames => [filename]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the new Ruby 1.9 hash syntax. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the new Ruby 1.9 hash syntax. |
||
|
||
output = converter.convert(false) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I remove a line here which check if file exists. Since the above |
||
assert_equal expected_output, output | ||
|
||
# clean up | ||
system("rm -rf ./" + csv_filename) | ||
end | ||
end |
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space inside { missing.
Line is too long. [84/80]
Space inside } missing.