<commit_before>require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
require 'i18n/backend/chain'

module ChainSetup
  def setup
    super
    first = I18n::Backend::Simple.new
    # first.store_translations(:en, translations)
    I18n.backend = I18n::Backend::Chain.new(first, I18n.backend)
  end
end

class I18nChainBackendApiBasicsTest < Test::Unit::TestCase
  include ChainSetup
  include Tests::Backend::Api::Basics
end

class I18nChainBackendApiTranslateTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include ChainSetup
  include Tests::Backend::Api::Translation
end

class I18nChainBackendApiInterpolateTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include ChainSetup
  include Tests::Backend::Api::Interpolation
end

class I18nChainBackendApiLambdaTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include ChainSetup
  include Tests::Backend::Api::Lambda
end

class I18nChainBackendApiTranslateLinkedTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include ChainSetup
  include Tests::Backend::Api::Link
end

class I18nChainBackendApiPluralizationTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include ChainSetup
  include Tests::Backend::Api::Pluralization
end

class I18nChainBackendApiLocalizeDateTest < Test::Unit::TestCase
  include ChainSetup
  include Tests::Backend::Simple::Setup::Localization
  include Tests::Backend::Api::Localization::Date
end

class I18nChainBackendApiLocalizeDateTimeTest < Test::Unit::TestCase
  include ChainSetup
  include Tests::Backend::Simple::Setup::Localization
  include Tests::Backend::Api::Localization::DateTime
end

class I18nChainBackendApiLocalizeTimeTest < Test::Unit::TestCase
  include ChainSetup
  include Tests::Backend::Simple::Setup::Localization
  include Tests::Backend::Api::Localization::Time
end

class I18nChainBackendApiLocalizeLambdaTest < Test::Unit::TestCase
  include ChainSetup
  include Tests::Backend::Simple::Setup::Localization
  include Tests::Backend::Api::Localization::Lambda
end
<commit_msg>fix chained backend tests, erroneously used Simple backend for some tests (thanks to thedarkone for pointing this out!)<commit_after>require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
require 'i18n/backend/chain'

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

  def test_using_chain_backend
    assert_equal I18n::Backend::Chain, I18n.backend.class
  end
end

class I18nChainBackendApiBasicsTest < Test::Unit::TestCase
  include ChainSetup
  include Tests::Backend::Api::Basics
end

class I18nChainBackendApiTranslateTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include ChainSetup
  include Tests::Backend::Api::Translation
end

class I18nChainBackendApiInterpolateTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include ChainSetup
  include Tests::Backend::Api::Interpolation
end

class I18nChainBackendApiLambdaTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include ChainSetup
  include Tests::Backend::Api::Lambda
end

class I18nChainBackendApiTranslateLinkedTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include ChainSetup
  include Tests::Backend::Api::Link
end

class I18nChainBackendApiPluralizationTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include ChainSetup
  include Tests::Backend::Api::Pluralization
end

class I18nChainBackendApiLocalizeDateTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include Tests::Backend::Simple::Setup::Localization
  include ChainSetup
  include Tests::Backend::Api::Localization::Date
end

class I18nChainBackendApiLocalizeDateTimeTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include Tests::Backend::Simple::Setup::Localization
  include ChainSetup
  include Tests::Backend::Api::Localization::DateTime
end

class I18nChainBackendApiLocalizeTimeTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include Tests::Backend::Simple::Setup::Localization
  include ChainSetup
  include Tests::Backend::Api::Localization::Time
end

class I18nChainBackendApiLocalizeLambdaTest < Test::Unit::TestCase
  include Tests::Backend::Simple::Setup::Base
  include Tests::Backend::Simple::Setup::Localization
  include ChainSetup
  include Tests::Backend::Api::Localization::Lambda
end

{'fraction_non_alphanumeric': 0.11060408518035637, 'fraction_numerical': 0.013906996957844416, 'mean_word_length': 7.937864077669903, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1339411', 'n_tokens_mistral': 1316, 'n_tokens_neox': 1347, 'n_words': 263}