Sha256: 72f047c282b1e1559f38d58452852e16f34b5d5e63d8246d1ac10e0ccf7d80e7

Contents?: true

Size: 828 Bytes

Versions: 1

Compression:

Stored size: 828 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

1 entries across 1 versions & 1 rubygems

Version Path
i18n-0.3.0 test/backend/simple/lookup_test.rb