<commit_before>require 'rubygems'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))

require 'rspec'
require 'github_api'

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

RSpec.configure do |config|
  
end<commit_msg>Add spec helper request matchers from webmock.<commit_after>require 'rubygems'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))

require 'rspec'
require 'webmock/rspec'
require 'github_api'

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

RSpec.configure do |config|
  config.include WebMock::API
end

def stub_get(path, endpoint = Github.endpoint)
  stub_request(:get, endpoint + path)
end

def stub_post(path, endpoint = Github.endpoint)
  stub_request(:post, endpoint + path)
end

def stub_patch(path, endpoint = Github.endpoint)
  stub_request(:patch, endpoint + path)
end

def stub_put(path, endpoint = Github.endpoint)
  stub_request(:put, endpoint + path)
end

def stub_delete(path, endpoint = Github.endpoint)
  stub_request(:delete, endpoint + path)
end

def a_get(path, endpoint = Github.endpoint)
  a_request(:get, endpoint + path)
end

def a_post(path, endpoint = Github.endpoint)
  a_request(:post, endpoint + path)
end

def a_patch(path, endpoint = Github.endpoint)
  a_request(:patch, endpoint + path)
end

def a_put(path, endpoint = Github.endpoint)
  a_request(:put, endpoint + path)
end

def a_delete(path, endpoint = Github.endpoint)
  a_request(:delete, endpoint + path)
end

def fixture_path
  File.expand_path("../fixtures", __FILE__)
end

def fixture(file)
  File.new(File.join(fixture_path, '/', file))
end
{'fraction_non_alphanumeric': 0.13641078838174273, 'fraction_numerical': 0.0, 'mean_word_length': 5.583617747440273, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5481789', 'n_tokens_mistral': 656, 'n_tokens_neox': 661, 'n_words': 161}