Sha256: a672e45b0a3e4eb880626b6e87eefdcabf3980e95b4471cba4dd7b44d490b823

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

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

describe I18n, "Russian pluralization" do
  before(:each) do
    @hash = {:one => 'вещь', :few => 'вещи', :many => 'вещей', :other => 'вещи'}
    @backend = I18n.backend
  end
  
  it "should pluralize correctly" do
    @backend.send(:pluralize, :'ru-RU', @hash, 1).should == 'вещь'
    @backend.send(:pluralize, :'ru-RU', @hash, 2).should == 'вещи'
    @backend.send(:pluralize, :'ru-RU', @hash, 3).should == 'вещи'
    @backend.send(:pluralize, :'ru-RU', @hash, 5).should == 'вещей'
    @backend.send(:pluralize, :'ru-RU', @hash, 10).should == 'вещей'
    @backend.send(:pluralize, :'ru-RU', @hash, 21).should == 'вещь'
    @backend.send(:pluralize, :'ru-RU', @hash, 29).should == 'вещей'
    @backend.send(:pluralize, :'ru-RU', @hash, 129).should == 'вещей'
    @backend.send(:pluralize, :'ru-RU', @hash, 131).should == 'вещь'
    @backend.send(:pluralize, :'ru-RU', @hash, 1.31).should == 'вещи'
    @backend.send(:pluralize, :'ru-RU', @hash, 2.31).should == 'вещи'
    @backend.send(:pluralize, :'ru-RU', @hash, 3.31).should == 'вещи'
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
yaroslav-russian-0.0.4 spec/i18n/locale/pluralization_spec.rb
russian-0.0.4 spec/i18n/locale/pluralization_spec.rb