Sha256: 0a3240a7617ab15da3afe5767c04cea3d0366b27b94e4e42889bca80d76b97f8

Contents?: true

Size: 1.15 KB

Versions: 16

Compression:

Stored size: 1.15 KB

Contents

require File.expand_path("spec_helper", File.dirname(__FILE__))

FastGettext.silence_errors

describe GettextI18nRails do
  it "extends all classes with fast_gettext" do
    _('test')
  end

  it "sets up out backend" do
    I18n.backend.is_a?(GettextI18nRails::Backend).should be_true
  end

  it "has a VERSION" do
    GettextI18nRails::VERSION.should =~ /^\d+\.\d+\.\d+$/
  end

  describe 'FastGettext I18n interaction' do
    before do
      FastGettext.available_locales = nil
      FastGettext.locale = 'de'
    end

    it "links FastGettext with I18n locale" do
      FastGettext.locale = 'xx'
      I18n.locale.should == :xx
    end

    it "does not set an not-accepted locale to I18n.locale" do
      FastGettext.available_locales = ['de']
      FastGettext.locale = 'xx'
      I18n.locale.should == :de
    end

    it "links I18n.locale and FastGettext.locale" do
      I18n.locale = :yy
      FastGettext.locale.should == 'yy'
    end

    it "does not set a non-available locale thorugh I18n.locale" do
      FastGettext.available_locales = ['de']
      I18n.locale = :xx
      FastGettext.locale.should == 'de'
      I18n.locale.should == :de
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
zena-1.0.0.rc2 vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails_spec.rb
zena-1.0.0.rc1 vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails_spec.rb
gettext_i18n_rails-0.2.4 spec/gettext_i18n_rails_spec.rb
zena-1.0.0.beta3 vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails_spec.rb
gettext_i18n_rails-0.2.3 spec/gettext_i18n_rails_spec.rb
gettext_i18n_rails-0.2.2 spec/gettext_i18n_rails_spec.rb
zena-1.0.0.beta2 vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails_spec.rb
zena-1.0.0.beta1 vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails_spec.rb
gettext_i18n_rails-0.2.1 spec/gettext_i18n_rails_spec.rb
gettext_i18n_rails-0.2.0 spec/gettext_i18n_rails_spec.rb
gettext_i18n_rails-0.1.5 spec/gettext_i18n_rails_spec.rb
gettext_i18n_rails-0.1.4 spec/gettext_i18n_rails_spec.rb
gettext_i18n_rails-0.1.3 spec/gettext_i18n_rails_spec.rb
gettext_i18n_rails-0.1.2 spec/gettext_i18n_rails_spec.rb
gettext_i18n_rails-0.1.1 spec/gettext_i18n_rails_spec.rb
gettext_i18n_rails-0.1.0 spec/gettext_i18n_rails_spec.rb