Sha256: bbb5a493602bd8ba002bfbc2eeeb807f5f4b95eb2f0fa73f372bb27b061b6973

Contents?: true

Size: 786 Bytes

Versions: 5

Compression:

Stored size: 786 Bytes

Contents

require 'test_helper'

class I18nBackendExceptionsTest < Test::Unit::TestCase
  def setup
    I18n.backend = I18n::Backend::Simple.new
  end

  test "exceptions: MissingTranslationData message from #translate includes the given scope and full key" do
    begin
      I18n.t(:'baz.missing', :scope => :'foo.bar', :raise => true)
    rescue I18n::MissingTranslationData => exception
    end
    assert_equal "translation missing: en.foo.bar.baz.missing", exception.message
  end

  test "exceptions: MissingTranslationData message from #localize includes the given scope and full key" do
    begin
      I18n.l(Time.now, :format => :foo)
    rescue I18n::MissingTranslationData => exception
    end
    assert_equal "translation missing: en.time.formats.foo", exception.message
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
i18n-0.5.4 test/backend/exceptions_test.rb
sayso-i18n-0.5.0.001 test/backend/exceptions_test.rb
i18n-0.5.0 test/backend/exceptions_test.rb
i18n-0.5.0beta3 test/backend/exceptions_test.rb
i18n-0.5.0beta2 test/backend/exceptions_test.rb