Sha256: 355e8a061504466a13da199805556bad4a8adf80d16b3b926967b609987080a1

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 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', @hash, 1).should == 'one'
    @backend.send(:pluralize, :'ru', @hash, 2).should == 'few'
    @backend.send(:pluralize, :'ru', @hash, 3).should == 'few'
    @backend.send(:pluralize, :'ru', @hash, 5).should == 'many'
    @backend.send(:pluralize, :'ru', @hash, 10).should == 'many'
    @backend.send(:pluralize, :'ru', @hash, 11).should == 'many'
    @backend.send(:pluralize, :'ru', @hash, 21).should == 'one'
    @backend.send(:pluralize, :'ru', @hash, 29).should == 'many'
    @backend.send(:pluralize, :'ru', @hash, 131).should == 'one'
    @backend.send(:pluralize, :'ru', @hash, 1.31).should == 'other'
    @backend.send(:pluralize, :'ru', @hash, 2.31).should == 'other'
    @backend.send(:pluralize, :'ru', @hash, 3.31).should == 'other'
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
yaroslav-russian-0.0.9 spec/i18n/locale/pluralization_spec.rb
yaroslav-russian-0.1.0 spec/i18n/locale/pluralization_spec.rb
yaroslav-russian-0.1.1 spec/i18n/locale/pluralization_spec.rb
yaroslav-russian-0.1.2 spec/i18n/locale/pluralization_spec.rb
yaroslav-russian-0.1.3 spec/i18n/locale/pluralization_spec.rb
russian-0.1.1 spec/i18n/locale/pluralization_spec.rb
russian-0.0.9 spec/i18n/locale/pluralization_spec.rb
russian-0.1.0 spec/i18n/locale/pluralization_spec.rb
russian-0.1.2 spec/i18n/locale/pluralization_spec.rb
russian-0.1.3 spec/i18n/locale/pluralization_spec.rb