Class I18nSimpleBackendInterpolateTest
In: vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb
Parent: Test::Unit::TestCase

Methods

Included Modules

I18nSimpleBackendTestSetup

Public Instance methods

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 264
264:     def test_interpolate_given_a_non_unicode_multibyte_value_hash_interpolates_into_a_string_with_the_same_encoding
265:       assert_equal euc_jp('Hi ゆきひろ!'), @backend.send(:interpolate, nil, 'Hi {{name}}!', :name => euc_jp('ゆきひろ'))
266:     end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 274
274:     def test_interpolate_given_a_non_unicode_multibyte_value_hash_into_an_unicode_string_raises_encoding_compatibility_error
275:       assert_raise(Encoding::CompatibilityError) do
276:         @backend.send(:interpolate, nil, 'こんにちは、{{name}}さん!', :name => euc_jp('ゆきひろ'))
277:       end
278:     end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 297
297:   def test_interpolate_given_a_string_containing_a_reserved_key_raises_reserved_interpolation_key
298:     assert_raise(I18n::ReservedInterpolationKey) { @backend.send(:interpolate, nil, '{{default}}', {:default => nil}) }
299:   end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 251
251:   def test_interpolate_given_a_value_hash_interpolates_into_unicode_string
252:     assert_equal 'Häi David!', @backend.send(:interpolate, nil, 'Häi {{name}}!', :name => 'David')
253:   end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 247
247:   def test_interpolate_given_a_value_hash_interpolates_the_values_to_the_string
248:     assert_equal 'Hi David!', @backend.send(:interpolate, nil, 'Hi {{name}}!', :name => 'David')
249:   end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 289
289:   def test_interpolate_given_a_values_hash_with_nil_values_interpolates_the_string
290:     assert_equal 'Hi !', @backend.send(:interpolate, nil, 'Hi {{name}}!', {:name => nil})
291:   end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 293
293:   def test_interpolate_given_an_empty_values_hash_raises_missing_interpolation_argument
294:     assert_raise(I18n::MissingInterpolationArgument) { @backend.send(:interpolate, nil, 'Hi {{name}}!', {}) }
295:   end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 285
285:   def test_interpolate_given_an_non_string_as_a_string_returns_nil
286:     assert_equal [], @backend.send(:interpolate, nil, [], :name => 'David')
287:   end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 259
259:   def test_interpolate_given_an_unicode_value_hash_interpolates_into_unicode_string
260:     assert_equal 'こんにちは、ゆきひろさん!', @backend.send(:interpolate, nil, 'こんにちは、{{name}}さん!', :name => 'ゆきひろ')
261:   end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 255
255:   def test_interpolate_given_an_unicode_value_hash_interpolates_to_the_string
256:     assert_equal 'Hi ゆきひろ!', @backend.send(:interpolate, nil, 'Hi {{name}}!', :name => 'ゆきひろ')
257:   end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 268
268:     def test_interpolate_given_an_unicode_value_hash_into_a_non_unicode_multibyte_string_raises_encoding_compatibility_error
269:       assert_raise(Encoding::CompatibilityError) do
270:         @backend.send(:interpolate, nil, euc_jp('こんにちは、{{name}}さん!'), :name => 'ゆきひろ')
271:       end
272:     end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 281
281:   def test_interpolate_given_nil_as_a_string_returns_nil
282:     assert_nil @backend.send(:interpolate, nil, nil, :name => 'David')
283:   end

[Validate]