Sha256: f73ce2f6e1c13d4a0fa1c225141f61ee5ee0f14b18aaa2598aa7e8c0618b20b7

Contents?: true

Size: 1.33 KB

Versions: 450

Compression:

Stored size: 1.33 KB

Contents

# encoding: utf-8

module I18n
  module Tests
    module Pluralization
      test "pluralization: given 0 it returns the :zero translation if it is defined" do
        assert_equal 'zero', I18n.t(:default => { :zero => 'zero' }, :count => 0)
      end

      test "pluralization: given 0 it returns the :other translation if :zero is not defined" do
        assert_equal 'bars', I18n.t(:default => { :other => 'bars' }, :count => 0)
      end

      test "pluralization: given 1 it returns the singular translation" do
        assert_equal 'bar', I18n.t(:default => { :one => 'bar' }, :count => 1)
      end

      test "pluralization: given 2 it returns the :other translation" do
        assert_equal 'bars', I18n.t(:default => { :other => 'bars' }, :count => 2)
      end

      test "pluralization: given 3 it returns the :other translation" do
        assert_equal 'bars', I18n.t(:default => { :other => 'bars' }, :count => 3)
      end

      test "pluralization: given nil it returns the whole entry" do
        assert_equal({ :one => 'bar' }, I18n.t(:default => { :one => 'bar' }, :count => nil))
      end

      test "pluralization: given incomplete pluralization data it raises I18n::InvalidPluralizationData" do
        assert_raise(I18n::InvalidPluralizationData) { I18n.t(:default => { :one => 'bar' }, :count => 2) }
      end
    end
  end
end

Version data entries

450 entries across 393 versions & 81 rubygems

Version Path
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/i18n-1.8.10/lib/i18n/tests/pluralization.rb
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/i18n-0.9.5/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.9 vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.8 vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/gems/i18n-0.6.9/lib/i18n/tests/pluralization.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/i18n-1.8.10/lib/i18n/tests/pluralization.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/i18n-1.8.10/lib/i18n/tests/pluralization.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/i18n-1.8.5/lib/i18n/tests/pluralization.rb