This repository has been archived on 2025-03-22. You can view files and clone it, but cannot push or open issues or pull requests.
twine/test/references/references_test.rb
2015-10-22 19:53:59 +02:00

47 lines
1.6 KiB
Ruby

require 'twine_test_case'
class ReferencesTest < TwineTestCase
def fixture_path
'references/fixtures'
end
def test_consumption_preserves_references
input = 'twine_value_reference.txt'
execute "consume-string-file #{f input} #{f 'empty.xml'} -l en"
assert_equal content(input), output_content
end
def test_consumption_does_not_add_unchanged_translation
input = 'twine_value_reference.txt'
execute "consume-string-file #{f input} #{f 'same_value.xml'} -l en"
assert_equal content(input), output_content
end
def test_consumption_adds_changed_translation
execute "consume-string-file #{f 'twine_value_reference.txt'} #{f 'different_value.xml'} -l en"
assert_equal content('twine_updated_value.txt'), output_content
end
def test_consuption_does_not_add_comment
input = 'twine_comment_reference.txt'
execute "consume-string-file #{f input} #{f 'empty.xml'} -l en"
assert_equal content(input), output_content
end
def test_consumption_does_not_add_unchanged_comment
input = 'twine_comment_reference.txt'
execute "consume-string-file #{f input} #{f 'same_comment.xml'} -l en -c"
assert_equal content(input), output_content
end
def test_consumption_adds_changed_comment
execute "consume-string-file #{f 'twine_comment_reference.txt'} #{f 'different_comment.xml'} -l en -c"
assert_equal content('twine_updated_comment.txt'), output_content
end
def test_consumption_does_not_add_tags
input = 'twine_tag_reference.txt'
execute "consume-string-file #{f input} #{f 'empty.xml'} -l en -c"
assert_equal content(input), output_content
end
end