Update test cases to work with recent formatter changes.

This commit is contained in:
Sebastian Celis 2012-03-21 11:27:14 -05:00
parent 7014d193b4
commit b886d78198
4 changed files with 12 additions and 9 deletions

View file

@ -76,8 +76,8 @@ module Twine
printed_section = false
section.rows.each do |row|
if row.matches_tags?(@options[:tags], @options[:untagged])
f.puts ''
if !printed_section
f.puts ''
if section.name && section.name.length > 0
f.print "/********** #{section.name} **********/\n\n"
end
@ -99,7 +99,7 @@ module Twine
f.print "/* #{comment} */\n"
end
f.print "\"#{key}\" = \"#{value}\";\n\n"
f.print "\"#{key}\" = \"#{value}\";\n"
end
end
end

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Android Strings File -->
<!-- Generated by Twine -->
<!-- Generated by Twine <%= Twine::VERSION %> -->
<!-- Language: fr -->
<resources>
<!-- My Strings -->

View file

@ -1,9 +1,11 @@
/**
* iOS Strings File
* Generated by Twine
* Apple Strings File
* Generated by Twine <%= Twine::VERSION %>
* Language: en
*/
/* My Strings */
/********** My Strings **********/
"key1" = "key1-english";
"key3" = "key3-english";

View file

@ -1,3 +1,4 @@
require 'ERB'
require 'test/unit'
require 'twine'
@ -6,7 +7,7 @@ class TwineTest < Test::Unit::TestCase
Dir.mktmpdir do |dir|
output_path = File.join(dir, 'fr.xml')
Twine::Runner.run(%W(generate-string-file test/fixtures/strings-1.txt #{output_path} --include-untranslated))
assert_equal(File.read('test/fixtures/test-output-1.txt'), File.read(output_path))
assert_equal(ERB.new(File.read('test/fixtures/test-output-1.txt')).result, File.read(output_path))
end
end
@ -14,7 +15,7 @@ class TwineTest < Test::Unit::TestCase
Dir.mktmpdir do |dir|
output_path = File.join(dir, 'en.strings')
Twine::Runner.run(%W(generate-string-file test/fixtures/strings-1.txt #{output_path} -t tag1))
assert_equal(File.read('test/fixtures/test-output-2.txt'), File.read(output_path))
assert_equal(ERB.new(File.read('test/fixtures/test-output-2.txt')).result, File.read(output_path))
end
end
@ -33,7 +34,7 @@ class TwineTest < Test::Unit::TestCase
assert_equal(File.read('test/fixtures/test-output-4.txt'), File.read(output_path))
end
end
def test_generate_report_1
Twine::Runner.run(%w(generate-report test/fixtures/strings-1.txt))
end