-
Notifications
You must be signed in to change notification settings - Fork 80
Added comments to output. #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
Changes from 19 commits
5f68962
a9e06ef
19c4cd0
7ae98bb
0cf5dab
2a87a91
feab4b1
d8757eb
f857e06
f1375ab
2528ec9
1a1498e
f90246c
8879cab
4d3b1b1
a8f31cf
03f6b13
274836b
77cc37f
308b39a
a88fd62
70521d2
b084e0f
3c779a6
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 |
|---|---|---|
|
|
@@ -3,9 +3,10 @@ class TestCSV2Android < Test::Unit::TestCase | |
|
|
||
| def test_converting_csv_to_xml | ||
| csv_file = "test/data/test_data.csv" | ||
| converter = Babelish::CSV2Android.new(csv_file, 'English' => "en") | ||
| converter = Babelish::CSV2Android.new(csv_file, "English" => "en") | ||
| converter.convert | ||
| assert File.exist?("values-en/strings.xml"), "the ouptut file does not exist" | ||
| assert File.exist?("values-en/strings.xml"), | ||
| "the ouptut file does not exist" | ||
|
|
||
| # clean up | ||
| system("rm -rf ./values-en") | ||
|
|
@@ -15,24 +16,48 @@ def test_converting_csv_with_special_chars | |
| csv_file = "test/data/android_special_chars.csv" | ||
| converter = Babelish::CSV2Android.new(csv_file, "german" => "de") | ||
| converter.convert | ||
| assert File.exist?("values-de/strings.xml"), "the ouptut file does not exist" | ||
| assert_equal File.read("test/data/android_special_chars_test_result.xml"), File.read("values-de/strings.xml") | ||
| assert File.exist?("values-de/strings.xml"), | ||
| "the ouptut file does not exist" | ||
|
Collaborator
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. Align the parameters of a method call if they span more than one line. |
||
| assert_equal | ||
| File.read("test/data/android_special_chars_test_result.xml"), | ||
|
Collaborator
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. unexpected token tCOMMA
Collaborator
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. unexpected token tCOMMA
Collaborator
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. unexpected token tCOMMA |
||
| File.read("values-de/strings.xml") | ||
|
|
||
| # clean up | ||
| system("rm -rf ./values-de") | ||
| end | ||
|
|
||
| def test_converting_csv_to_dotstrings_one_output_option | ||
| csv_file = "test/data/test_data.csv" | ||
| single_file = 'myApp.xml' | ||
| converter = Babelish::CSV2Android.new(csv_file, | ||
| {'English' => "en"}, | ||
| :output_basename => 'myApp', | ||
| :ignore_lang_path => true) | ||
| single_file = "myApp.xml" | ||
| converter = Babelish::CSV2Android.new( | ||
| csv_file, | ||
| { "English" => "en" }, | ||
| :output_basename => "myApp", | ||
|
Collaborator
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. Align the parameters of a method call if they span more than one line. |
||
| :ignore_lang_path => true | ||
| ) | ||
| converter.convert | ||
| assert File.exist?(single_file), "the ouptut file does not exist" | ||
|
|
||
| # clean up | ||
| system("rm -rf ./" + single_file) | ||
| end | ||
|
|
||
| def test_converting_with_comments | ||
| csv_file = "test/data/test_data_with_comments.csv" | ||
| french_file = "values-fr/strings.xml" | ||
| expected_output = File.read("test/data/test_data_fr_with_comments.xml") | ||
| converter = Babelish::CSV2Android.new( | ||
| csv_file, | ||
| { "French" => "fr" }, | ||
| :default_lang => "English", | ||
|
Collaborator
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. Align the parameters of a method call if they span more than one line. |
||
| :comments_column => 5 | ||
| ) | ||
| converter.convert | ||
| assert File.exist?(french_file), "the ouptut file does not exist" | ||
| result = File.read(french_file) | ||
| assert_equal expected_output, result | ||
|
|
||
|
Collaborator
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. Tab detected. |
||
| # clean up | ||
| system("rm -rf values-fr") | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <resources> | ||
|
|
||
| <!-- this is a greeting string --> | ||
| <string name="GREETINGS">Salut</string> | ||
|
|
||
| <!-- this is another example --> | ||
| <string name="ANOTHER_STRING">testEN</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.
Align the parameters of a method call if they span more than one line.