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:
authorPhilippe Auriach <p.auriach@gmail.com>2017-10-13 12:49:56 +0300
committerPhilippe Auriach <p.auriach@gmail.com>2017-10-13 12:49:56 +0300
commitf5af8cf6708b9c1a0b40e11c02c858a82dc578b2 (patch)
tree806769f47494e9c846fe2be443d2932c21f3c149
parent21fdd84682f59310a66526fd95c054feb8da58b5 (diff)
Added test for base folder resolved to developer_language option value
-rw-r--r--test/test_formatters.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/test_formatters.rb b/test/test_formatters.rb
index ae30787..895e3cd 100644
--- a/test/test_formatters.rb
+++ b/test/test_formatters.rb
@@ -19,7 +19,7 @@ class FormatterTest < TwineTest
@empty_twine_file = Twine::TwineFile.new
@formatter = formatter_class.new
@formatter.twine_file = @empty_twine_file
- @formatter.options = { consume_all: true, consume_comments: true }
+ @formatter.options = { consume_all: true, consume_comments: true, developer_language: 'en' }
end
def assert_translations_read_correctly
@@ -39,7 +39,7 @@ end
class TestAndroidFormatter < FormatterTest
def setup
super Twine::Formatters::Android
-
+
@escape_test_values = {
'this & that' => 'this &amp; that',
'this < that' => 'this &lt; that',
@@ -193,6 +193,16 @@ class TestAppleFormatter < FormatterTest
assert_file_contents_read_correctly
end
+ def test_deducts_language_from_resource_folder
+ language = %w(en de fr).sample
+ assert_equal language, @formatter.determine_language_given_path("#{language}.lproj/Localizable.strings")
+ end
+
+ def test_deducts_base_language_from_resource_folder
+ #from options developer_language = 'en'
+ assert_equal 'en', @formatter.determine_language_given_path('Base.lproj/Localizations.strings')
+ end
+
def test_reads_quoted_keys
@formatter.read StringIO.new('"key" = "value"'), 'en'
assert_equal 'value', @empty_twine_file.definitions_by_key['key'].translations['en']