mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Ruby 1.9+ uses Minitest as the backend for Test::Unit. As of Minitest 5, the shim has broken some compatibility with Test::Unit::TestCase in some scenarios. Adjusts the test suite to support Minitest 5's syntax. Minitest versions 4 and below do not support the newer Minitest::Test class that arrived in version 5. For that case, use the MiniTest::Unit::TestCase class as a fallback Conflicts: test/integration/tags/for_tag_test.rb test/test_helper.rb
38 lines
934 B
Ruby
38 lines
934 B
Ruby
require 'test_helper'
|
|
|
|
class I18nUnitTest < Minitest::Test
|
|
include Liquid
|
|
|
|
def setup
|
|
@i18n = I18n.new(fixture("en_locale.yml"))
|
|
end
|
|
|
|
def test_simple_translate_string
|
|
assert_equal "less is more", @i18n.translate("simple")
|
|
end
|
|
|
|
def test_nested_translate_string
|
|
assert_equal "something wasn't right", @i18n.translate("errors.syntax.oops")
|
|
end
|
|
|
|
def test_single_string_interpolation
|
|
assert_equal "something different", @i18n.translate("whatever", :something => "different")
|
|
end
|
|
|
|
# def test_raises_translation_error_on_undefined_interpolation_key
|
|
# assert_raises I18n::TranslationError do
|
|
# @i18n.translate("whatever", :oopstypos => "yes")
|
|
# end
|
|
# end
|
|
|
|
def test_raises_unknown_translation
|
|
assert_raises I18n::TranslationError do
|
|
@i18n.translate("doesnt_exist")
|
|
end
|
|
end
|
|
|
|
def test_sets_default_path_to_en
|
|
assert_equal I18n::DEFAULT_LOCALE, I18n.new.path
|
|
end
|
|
end
|