diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-27 22:52:50 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-27 22:52:50 +0200 |
| commit | 9a19a0494ef51cdac9a78e24d517ca48ba44c453 (patch) | |
| tree | 8eaae12d8047a40e29d3ea7ff3116b5c869e04bd /vendor/plugins/globalize2/test/i18n | |
| parent | 85a01e35274b8d4d4165a7b26bd7986e211246bb (diff) | |
| parent | 1853082fcd8c067390c246f9daa01a9b47387497 (diff) | |
Migration from Rails 2.3.5 to Rails 8.1 successful.
Merging dev branch.
Diffstat (limited to 'vendor/plugins/globalize2/test/i18n')
| -rw-r--r-- | vendor/plugins/globalize2/test/i18n/missing_translations_test.rb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/vendor/plugins/globalize2/test/i18n/missing_translations_test.rb b/vendor/plugins/globalize2/test/i18n/missing_translations_test.rb deleted file mode 100644 index 5d0ecd6f..00000000 --- a/vendor/plugins/globalize2/test/i18n/missing_translations_test.rb +++ /dev/null | |||
| @@ -1,36 +0,0 @@ | |||
| 1 | require File.dirname(__FILE__) + '/../test_helper' | ||
| 2 | require 'i18n/missing_translations_log_handler' | ||
| 3 | |||
| 4 | class MissingTranslationsTest < ActiveSupport::TestCase | ||
| 5 | test "defines I18n.missing_translations_logger accessor" do | ||
| 6 | assert I18n.respond_to?(:missing_translations_logger) | ||
| 7 | end | ||
| 8 | |||
| 9 | test "defines I18n.missing_translations_logger= writer" do | ||
| 10 | assert I18n.respond_to?(:missing_translations_logger=) | ||
| 11 | end | ||
| 12 | end | ||
| 13 | |||
| 14 | class TestLogger < String | ||
| 15 | def warn(msg) self.concat msg; end | ||
| 16 | end | ||
| 17 | |||
| 18 | class LogMissingTranslationsTest < ActiveSupport::TestCase | ||
| 19 | def setup | ||
| 20 | @locale, @key, @options = :en, :foo, {} | ||
| 21 | @exception = I18n::MissingTranslationData.new(@locale, @key, @options) | ||
| 22 | |||
| 23 | @logger = TestLogger.new | ||
| 24 | I18n.missing_translations_logger = @logger | ||
| 25 | end | ||
| 26 | |||
| 27 | test "still returns the exception message for MissingTranslationData exceptions" do | ||
| 28 | result = I18n.send(:missing_translations_log_handler, @exception, @locale, @key, @options) | ||
| 29 | assert_equal 'translation missing: en, foo', result | ||
| 30 | end | ||
| 31 | |||
| 32 | test "logs the missing translation to I18n.missing_translations_logger" do | ||
| 33 | I18n.send(:missing_translations_log_handler, @exception, @locale, @key, @options) | ||
| 34 | assert_equal 'translation missing: en, foo', @logger | ||
| 35 | end | ||
| 36 | end | ||
