Sha256: f1cea17e2c5c07f86fa87365c7cf3d72ad4fa25596eb188ca7d267df08f79927

Contents?: true

Size: 1.59 KB

Versions: 116

Compression:

Stored size: 1.59 KB

Contents

require 'test_helper'

begin
  require 'rubygems'
  require 'active_support'
rescue LoadError
  puts "not testing with Cache enabled because active_support can not be found"
end

class I18nAllFeaturesApiTest < I18n::TestCase
  class Backend < I18n::Backend::Simple
    include I18n::Backend::Metadata
    include I18n::Backend::Cache
    include I18n::Backend::Cascade
    include I18n::Backend::Fallbacks
    include I18n::Backend::Pluralization
    include I18n::Backend::Memoize
  end

  def setup
    I18n.backend = I18n::Backend::Chain.new(Backend.new, I18n::Backend::Simple.new)
    I18n.cache_store = cache_store
    super
  end

  def teardown
    I18n.cache_store.clear if I18n.cache_store
    I18n.cache_store = nil
    super
  end

  def cache_store
    ActiveSupport::Cache.lookup_store(:memory_store) if cache_available?
  end

  def cache_available?
    defined?(ActiveSupport) && defined?(ActiveSupport::Cache)
  end

  include I18n::Tests::Basics
  include I18n::Tests::Defaults
  include I18n::Tests::Interpolation
  include I18n::Tests::Link
  include I18n::Tests::Lookup
  include I18n::Tests::Pluralization
  include I18n::Tests::Procs
  include I18n::Tests::Localization::Date
  include I18n::Tests::Localization::DateTime
  include I18n::Tests::Localization::Time
  include I18n::Tests::Localization::Procs

  test "make sure we use a Chain backend with an all features backend" do
    assert_equal I18n::Backend::Chain, I18n.backend.class
    assert_equal Backend, I18n.backend.backends.first.class
  end

  # links: test that keys stored on one backend can link to keys stored on another backend
end

Version data entries

116 entries across 98 versions & 25 rubygems

Version Path
abaci-0.3.0 vendor/bundle/gems/i18n-0.7.0/test/api/all_features_test.rb
i18n-0.8.0.beta1 test/api/all_features_test.rb
second_step-0.1.2 secondstep-notify-1.0.0-osx/lib/ruby/lib/ruby/gems/2.2.0/gems/i18n-0.7.0/test/api/all_features_test.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/gems/i18n-0.7.0/test/api/all_features_test.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/gems/i18n-0.7.0/test/api/all_features_test.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/gems/i18n-0.7.0/test/api/all_features_test.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/gems/i18n-0.7.0/test/api/all_features_test.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/i18n-0.7.0/test/api/all_features_test.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/i18n-0.7.0/test/api/all_features_test.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/i18n-0.7.0/test/api/all_features_test.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/i18n-0.7.0/test/api/all_features_test.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/i18n-0.7.0/test/api/all_features_test.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/i18n-0.6.11/test/api/all_features_test.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/i18n-0.6.11/test/api/all_features_test.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/i18n-0.6.11/test/api/all_features_test.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/i18n-0.7.0/test/api/all_features_test.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/i18n-0.7.0/test/api/all_features_test.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/i18n-0.7.0/test/api/all_features_test.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/i18n-0.7.0/test/api/all_features_test.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/i18n-0.7.0/test/api/all_features_test.rb