<commit_before># This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../../../../../config/environment")

$:.unshift File.expand_path(RAILS_ROOT + "/vendor/gems/rspec-rails-1.1.4/lib")
$:.unshift File.expand_path(RAILS_ROOT + "/vendor/gems/rspec-1.1.4/lib")

require 'spec'
require 'spec/rails'

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'factories', 'factories'))

require 'globalize/i18n/missing_translations_raise_handler'
I18n.exception_handler = :missing_translations_raise_handler

# load spec helpers
spec_helpers_dir = File.dirname(__FILE__) + '/spec_helpers'
Dir[spec_helpers_dir + '/*.rb'].sort.each do |spec_helper_file|
  require spec_helper_file
end

# load all custom matchers
matchers_dir = File.dirname(__FILE__) + '/matchers'
Dir[matchers_dir + '/*.rb'].each do |matcher_file|
  require matcher_file
end

# load stubs and scenarios
Stubby::Definition.directory = File.dirname(__FILE__) + "/stubs"
Stubby::Scenario.directory = File.dirname(__FILE__) + "/scenarios"

Stubby.load

Stubby::Stub.class_eval do
  def role_context
    self.class.role_context_class.new(self)
  end
end

# load extensions
require "cacheable_flash/test_helpers"
require "rspec_on_rails_on_crack"
# AGW::CacheTest.setup
ActionController::TestResponse.send(:include, CacheableFlash::TestHelpers)

Spec::Rails::Example::RailsExampleGroup.class_eval do
  before :each do
    I18n.default_locale = :en # reset this because it will be changed in base controllers
    I18n.locale = nil
    
    # use this to test the completeness of, e.g., the locale :de
    # I18n.default_locale = :de
    # I18n.fallbacks = Globalize::Locale::Fallbacks::None
  end
end
  
Spec::Rails::Example::ControllerExampleGroup.class_eval do
  def params_from(method, path, env = {:host_with_port => 'test.host'})
    ensure_that_routes_are_loaded
    env.merge!({:method => method})
    ActionController::Routing::Routes.recognize_path(path, env)
  end
end

Spec::Runner.configure do |config|
  config.use_transactional_fixtures = true
  config.use_instantiated_fixtures  = false
  config.fixture_path = File.dirname(__FILE__) + '/fixtures/'
end<commit_msg>The old way of testing for complete translations didn't work.<commit_after># This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../../../../../config/environment")

$:.unshift File.expand_path(RAILS_ROOT + "/vendor/gems/rspec-rails-1.1.4/lib")
$:.unshift File.expand_path(RAILS_ROOT + "/vendor/gems/rspec-1.1.4/lib")

require 'spec'
require 'spec/rails'

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'factories', 'factories'))

require 'globalize/i18n/missing_translations_raise_handler'
I18n.exception_handler = :missing_translations_raise_handler

# load spec helpers
spec_helpers_dir = File.dirname(__FILE__) + '/spec_helpers'
Dir[spec_helpers_dir + '/*.rb'].sort.each do |spec_helper_file|
  require spec_helper_file
end

# load all custom matchers
matchers_dir = File.dirname(__FILE__) + '/matchers'
Dir[matchers_dir + '/*.rb'].each do |matcher_file|
  require matcher_file
end

# load stubs and scenarios
Stubby::Definition.directory = File.dirname(__FILE__) + "/stubs"
Stubby::Scenario.directory = File.dirname(__FILE__) + "/scenarios"

Stubby.load

Stubby::Stub.class_eval do
  def role_context
    self.class.role_context_class.new(self)
  end
end

# load extensions
require "cacheable_flash/test_helpers"
require "rspec_on_rails_on_crack"
# AGW::CacheTest.setup
ActionController::TestResponse.send(:include, CacheableFlash::TestHelpers)

Spec::Rails::Example::RailsExampleGroup.class_eval do
  before :each do
    I18n.default_locale = :en # reset this because it will be changed in base controllers
    I18n.locale = nil

    # use this to test the completeness of, e.g., the locale :de
    # I18n.default_locale = :de
    # I18n.fallbacks = { :de => [:de] }
  end
end

Spec::Rails::Example::ControllerExampleGroup.class_eval do
  def params_from(method, path, env = {:host_with_port => 'test.host'})
    ensure_that_routes_are_loaded
    env.merge!({:method => method})
    ActionController::Routing::Routes.recognize_path(path, env)
  end
end

Spec::Runner.configure do |config|
  config.use_transactional_fixtures = true
  config.use_instantiated_fixtures  = false
  config.fixture_path = File.dirname(__FILE__) + '/fixtures/'
end
{'fraction_non_alphanumeric': 0.12773403324584426, 'fraction_numerical': 0.007874015748031496, 'mean_word_length': 5.188092016238159, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '6629007', 'n_tokens_mistral': 1555, 'n_tokens_neox': 1541, 'n_words': 323}