Sha256: 3101197f2438dcd42926b0dd3d1f2a105d0c85f3891cc933280101e076d3c817

Contents?: true

Size: 826 Bytes

Versions: 5

Compression:

Stored size: 826 Bytes

Contents

# encoding: utf-8
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')

class I18nSimpleBackendLookupTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base

  # useful because this way we can use the backend with no key for interpolation/pluralization
  def test_lookup_given_nil_as_a_key_returns_nil
    assert_nil I18n.backend.send(:lookup, :en, nil)
  end

  def test_lookup_given_nested_keys_looks_up_a_nested_hash_value
    assert_equal 'bar', I18n.backend.send(:lookup, :en, :bar, [:foo])
  end

  def test_lookup_using_a_custom_separator
    assert_equal 'bar', I18n.backend.send(:lookup, :en, 'foo|bar', [], '|')
  end

  def test_default_using_a_custom_separator
    assert_equal 'bar', I18n.backend.send(:default, :en, :'does_not_exist', :'foo|bar', :separator => '|')
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
svenfuchs-i18n-0.2.0 test/backend/simple/lookup_test.rb
theoooo-i18n-0.2.0 test/backend/simple/lookup_test.rb
theoooo-i18n-0.2.1 test/backend/simple/lookup_test.rb
theoooo-i18n-0.2.2 test/backend/simple/lookup_test.rb
i18n-0.2.1 test/backend/simple/lookup_test.rb