Sha256: 2d1a0bda42c963b4e683d07dd1a7d386ceec238f384633a730daabe774323c07

Contents?: true

Size: 1018 Bytes

Versions: 116

Compression:

Stored size: 1018 Bytes

Contents

# encoding: utf-8
require 'test_helper'

class I18nLocaleTagSimpleTest < I18n::TestCase
  include I18n::Locale

  test "returns 'de' as the language subtag in lowercase" do
    assert_equal %w(de Latn DE), Tag::Simple.new('de-Latn-DE').subtags
  end

  test "returns a formatted tag string from #to_s" do
    assert_equal 'de-Latn-DE', Tag::Simple.new('de-Latn-DE').to_s
  end

  test "returns an array containing the formatted subtags from #to_a" do
    assert_equal %w(de Latn DE), Tag::Simple.new('de-Latn-DE').to_a
  end

  # Tag inheritance

  test "#parent returns 'de-Latn' as the parent of 'de-Latn-DE'" do
    assert_equal 'de-Latn', Tag::Simple.new('de-Latn-DE').parent.to_s
  end

  test "#parent returns 'de' as the parent of 'de-Latn'" do
    assert_equal 'de', Tag::Simple.new('de-Latn').parent.to_s
  end

  test "#self_and_parents returns an array of 3 tags for 'de-Latn-DE'" do
    assert_equal %w(de-Latn-DE de-Latn de), Tag::Simple.new('de-Latn-DE').self_and_parents.map { |tag| tag.to_s}
  end
end

Version data entries

116 entries across 98 versions & 25 rubygems

Version Path
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/i18n-0.9.5/test/locale/tag/simple_test.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/i18n-0.9.5/test/locale/tag/simple_test.rb
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/i18n-0.9.5/test/locale/tag/simple_test.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/i18n-0.9.5/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/i18n-1.1.1/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/i18n-0.8.0/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/i18n-1.1.1/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/i18n-1.1.1/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/i18n-1.1.1/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/i18n-1.1.1/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/i18n-0.8.0/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/i18n-1.1.1/test/locale/tag/simple_test.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/i18n-0.9.5/test/locale/tag/simple_test.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/i18n-0.9.5/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/i18n-0.8.0/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/i18n-1.1.1/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/i18n-1.1.1/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/i18n-0.8.0/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/i18n-1.1.1/test/locale/tag/simple_test.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/i18n-1.1.1/test/locale/tag/simple_test.rb