Class: I18nSimpleBackendLookupTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
Tests::Backend::Simple::Setup::Base
Defined in:
lib/vendor/i18n/test/backend/simple/lookup_test.rb

Instance Method Summary collapse

Methods included from Tests::Backend::Simple::Setup::Base

#setup, #teardown

Instance Method Details

#test_default_using_a_custom_separatorObject



21
22
23
# File 'lib/vendor/i18n/test/backend/simple/lookup_test.rb', line 21

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

#test_lookup_given_nested_keys_looks_up_a_nested_hash_valueObject



13
14
15
# File 'lib/vendor/i18n/test/backend/simple/lookup_test.rb', line 13

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

#test_lookup_given_nil_as_a_key_returns_nilObject

useful because this way we can use the backend with no key for interpolation/pluralization



9
10
11
# File 'lib/vendor/i18n/test/backend/simple/lookup_test.rb', line 9

def test_lookup_given_nil_as_a_key_returns_nil
  assert_nil I18n.backend.send(:lookup, :en, nil)
end

#test_lookup_using_a_custom_separatorObject



17
18
19
# File 'lib/vendor/i18n/test/backend/simple/lookup_test.rb', line 17

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