<commit_before>ENV['RACK_ENV'] = 'test'

require 'rubygems'
require 'bundler'

Bundler.require :default, :test

$:.unshift File.dirname(File.expand_path(__FILE__))
$:.unshift File.dirname(File.expand_path(__FILE__) + '/../lib')

require 'papermill-agent'
require 'fakeweb'

FakeWeb.allow_net_connect = false
FakeWeb.register_uri(:post, Papermill::API_ENDPOINT, {})

RSpec.configure do |config|
  def agent
    Papermill::Agent.instance
  end

  config.mock_with :rspec
  config.before(:each) do
    # clear the storage before each example
    Papermill::Storage.clear
  end
end<commit_msg>add mock_config_hash method to test env<commit_after>ENV['RACK_ENV'] = 'test'

require 'rubygems'
require 'bundler'

Bundler.require :default, :test

$:.unshift File.dirname(File.expand_path(__FILE__))
$:.unshift File.dirname(File.expand_path(__FILE__) + '/../lib')

require 'papermill-agent'
require 'fakeweb'

FakeWeb.allow_net_connect = false
FakeWeb.register_uri(:post, Papermill::API_ENDPOINT, {})

RSpec.configure do |config|
  def mock_config_hash
    {'token' => 'mock-<PASSWORD>'}
  end

  def agent
    Papermill::Agent.instance
  end

  config.mock_with :rspec
  config.before(:each) do
    # clear the storage before each example
    Papermill::Storage.clear
  end
end
{'fraction_non_alphanumeric': 0.1284475965327029, 'fraction_numerical': 0.0, 'mean_word_length': 5.0476190476190474, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '4469852', 'n_tokens_mistral': 444, 'n_tokens_neox': 432, 'n_words': 93}