Sha256: 1c15e24d726ee9096d7040151422fdaaead6c621ee4f4305ef1d759eb0b46a18

Contents?: true

Size: 1.08 KB

Versions: 8

Compression:

Stored size: 1.08 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

describe I18n, "Russian pluralization" do
  before(:each) do
    @hash = {}
    %w(one few many other).each do |key|
      @hash[key.to_sym] = key
    end
    @backend = I18n.backend
  end
  
  it "should pluralize correctly" do
    @backend.send(:pluralize, :'ru-RU', @hash, 1).should == 'one'
    @backend.send(:pluralize, :'ru-RU', @hash, 2).should == 'few'
    @backend.send(:pluralize, :'ru-RU', @hash, 3).should == 'few'
    @backend.send(:pluralize, :'ru-RU', @hash, 5).should == 'many'
    @backend.send(:pluralize, :'ru-RU', @hash, 10).should == 'many'
    @backend.send(:pluralize, :'ru-RU', @hash, 11).should == 'many'
    @backend.send(:pluralize, :'ru-RU', @hash, 21).should == 'one'
    @backend.send(:pluralize, :'ru-RU', @hash, 29).should == 'many'
    @backend.send(:pluralize, :'ru-RU', @hash, 131).should == 'one'
    @backend.send(:pluralize, :'ru-RU', @hash, 1.31).should == 'other'
    @backend.send(:pluralize, :'ru-RU', @hash, 2.31).should == 'other'
    @backend.send(:pluralize, :'ru-RU', @hash, 3.31).should == 'other'
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
yaroslav-russian-0.0.5 spec/i18n/locale/pluralization_spec.rb
yaroslav-russian-0.0.6 spec/i18n/locale/pluralization_spec.rb
yaroslav-russian-0.0.7 spec/i18n/locale/pluralization_spec.rb
yaroslav-russian-0.0.8 spec/i18n/locale/pluralization_spec.rb
russian-0.0.5 spec/i18n/locale/pluralization_spec.rb
russian-0.0.6 spec/i18n/locale/pluralization_spec.rb
russian-0.0.8 spec/i18n/locale/pluralization_spec.rb
russian-0.0.7 spec/i18n/locale/pluralization_spec.rb