Sha256: 813cda97f9c3f5381c77c981735952bf391d37ae542b4c0158af18bfa8bba1bc

Contents?: true

Size: 1 KB

Versions: 266

Compression:

Stored size: 1 KB

Contents

# encoding: utf-8
require 'test_helper'

class I18nLocaleTagSimpleTest < Test::Unit::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

266 entries across 236 versions & 47 rubygems

Version Path
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
logstash-codec-json-2.0.3 vendor/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
classiccms-0.7.5 vendor/bundle/gems/i18n-0.6.0/test/locale/tag/simple_test.rb
classiccms-0.7.4 vendor/bundle/gems/i18n-0.6.0/test/locale/tag/simple_test.rb
classiccms-0.7.3 vendor/bundle/gems/i18n-0.6.0/test/locale/tag/simple_test.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/test/locale/tag/simple_test.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/i18n-0.6.2/test/locale/tag/simple_test.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
whos_dated_who-0.1.0 vendor/bundle/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
whos_dated_who-0.0.1 vendor/bundle/gems/i18n-0.6.9/test/locale/tag/simple_test.rb
i18n-0.5.4 test/locale/tag/simple_test.rb
i18n-0.6.9 test/locale/tag/simple_test.rb