<commit_before>$TESTING = true

require 'simplecov'
require 'coveralls'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
  Coveralls::SimpleCov::Formatter
]

SimpleCov.start do
  add_filter '/spec/'
  minimum_coverage(92.21)
end

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'thor'
require 'thor/group'
require 'stringio'

require 'rdoc'
require 'rspec'
require 'diff/lcs' # You need diff/lcs installed to run specs (but not to run Thor).
require 'fakeweb'  # You need fakeweb installed to run specs (but not to run Thor).

# Set shell to basic
$0 = 'thor'
$thor_runner = true
ARGV.clear
Thor::Base.shell = Thor::Shell::Basic

# Load fixtures
load File.join(File.dirname(__FILE__), 'fixtures', 'enum.thor')
load File.join(File.dirname(__FILE__), 'fixtures', 'group.thor')
load File.join(File.dirname(__FILE__), 'fixtures', 'invoke.thor')
load File.join(File.dirname(__FILE__), 'fixtures', 'script.thor')
load File.join(File.dirname(__FILE__), 'fixtures', 'subcommand.thor')
load File.join(File.dirname(__FILE__), 'fixtures', 'command.thor')

RSpec.configure do |config|
  config.before do
    ARGV.replace []
  end

  config.expect_with :rspec do |c|<commit_msg>Specify an explicit external encoding for tests.<commit_after>$TESTING = true

require 'simplecov'
require 'coveralls'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
  Coveralls::SimpleCov::Formatter
]

SimpleCov.start do
  add_filter '/spec/'
  minimum_coverage(92.21)
end

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'thor'
require 'thor/group'
require 'stringio'

require 'rdoc'
require 'rspec'
require 'diff/lcs' # You need diff/lcs installed to run specs (but not to run Thor).
require 'fakeweb'  # You need fakeweb installed to run specs (but not to run Thor).

# Set shell to basic
$0 = 'thor'
$thor_runner = true
ARGV.clear
Encoding.default_external = Encoding::UTF_8 if RUBY_VERSION > '1.8.7'
Thor::Base.shell = Thor::Shell::Basic

# Load fixtures
load File.join(File.dirname(__FILE__), 'fixtures', 'enum.thor')
load File.join(File.dirname(__FILE__), 'fixtures', 'group.thor')
load File.join(File.dirname(__FILE__), 'fixtures', 'invoke.thor')
load File.join(File.dirname(__FILE__), 'fixtures', 'script.thor')
load File.join(File.dirname(__FILE__), 'fixtures', 'subcommand.thor')
load File.join(File.dirname(__FILE__), 'fixtures', 'command.thor')

RSpec.configure do |config|
  config.before do
    ARGV.replace []
  end

  config.expect_with :rspec do |c|
{'fraction_non_alphanumeric': 0.14511771516788885, 'fraction_numerical': 0.005403319181783096, 'mean_word_length': 5.785340314136126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5473015', 'n_tokens_mistral': 909, 'n_tokens_neox': 868, 'n_words': 218}