Sha256: 3a090496e608c6bda38349d5be1c9a445e62044b6c75316c68f0552e937f6bdf

Contents?: true

Size: 1.08 KB

Versions: 5

Compression:

Stored size: 1.08 KB

Contents

# -*- encoding: utf-8 -*- 

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
belorussian-0.6.4 spec/i18n/locale/pluralization_spec.rb
belorussian-0.6.3 spec/i18n/locale/pluralization_spec.rb
belorussian-0.6.2 spec/i18n/locale/pluralization_spec.rb
belorussian-0.6.1 spec/i18n/locale/pluralization_spec.rb
belorussian-0.6.0 spec/i18n/locale/pluralization_spec.rb