Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/twine.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_generate_localization_file.rb')
-rw-r--r--test/test_generate_localization_file.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/test_generate_localization_file.rb b/test/test_generate_localization_file.rb
index 6d4bb49..441e256 100644
--- a/test/test_generate_localization_file.rb
+++ b/test/test_generate_localization_file.rb
@@ -1,8 +1,7 @@
require 'command_test'
class TestGenerateLocalizationFile < CommandTest
- def new_runner(language, file)
- options = {}
+ def new_runner(language, file, options = {})
options[:output_path] = File.join(@output_dir, file) if file
options[:languages] = language if language
@@ -59,6 +58,17 @@ class TestGenerateLocalizationFile < CommandTest
end
end
+ def test_uses_specified_formatter_to_resolve_ambiguity
+ # both Android and Tizen use .xml
+ android_formatter = prepare_mock_formatter(Twine::Formatters::Android)
+ android_formatter.stubs(:format_file).returns(true)
+ tizen_formatter = prepare_mock_formatter(Twine::Formatters::Tizen, false)
+ tizen_formatter.stubs(:format_file).returns(true)
+
+ # implicit assert that this call doesn't raise an exception
+ new_runner('fr', 'fr.xml', format: 'android').generate_localization_file
+ end
+
def test_deducts_language_from_output_path
random_language = KNOWN_LANGUAGES.sample
formatter = prepare_mock_formatter Twine::Formatters::Android