Sha256: e570a3e17e2894a2e4b3fc59880a3db305fd8ef0c27e79272524272d3eb7ce17

Contents?: true

Size: 675 Bytes

Versions: 2

Compression:

Stored size: 675 Bytes

Contents

# encoding: utf-8

require "spec_helper"

describe 'I18n' do
  before :all do
    rad.web
    rad.reset :conveyors

    I18n.load_path += Dir["#{spec_dir}/locales/*/*.{rb,yml}"]
  end

  def t *args
    I18n.t *args
  end

  it "basic" do
    I18n.locale = 'en'
    t(:name).should == "Name"
    t(:name).is_a?(String).should be_true

    I18n.locale = 'ru'
    t(:name).should == "Имя"
  end

  it "pluggable pluralization" do
    I18n.locale = 'ru'
    t(:comments_count, count: 1).should == "1 комментарий"
    t(:comments_count, count: 2).should == "2 комментария"
    t(:comments_count, count: 5).should == "5 комментариев"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rad_kit-0.0.10 spec/i18n/i18n_spec.rb
rad_kit-0.0.9 spec/i18n/i18n_spec.rb