<commit_before>require "moip2"

require "vcr"
require "webmock"
require "simplecov"
SimpleCov.start

RSpec.configure do |config|
end
ENV["sandbox_url"] = "https://sandbox.moip.com.br"

VCR.configure do |c|
  c.cassette_library_dir = "vcr_cassettes"
  c.hook_into :webmock # or :fakeweb
  c.ignore_hosts "codeclimate.com"
end

# Helper methods
def sandbox_auth
  Moip2::Auth::Basic.new(
    "01010101010101010101010101010101",
    "ABABABABABABABABABABABABABABABABABABABAB",
  )
end

def sandbox_oauth
  Moip2::Auth::OAuth.new("9fdc242631454d4c95d82e27b4127394_v2")
end

def sandbox_client
  Moip2::Client.new(:sandbox, sandbox_auth)
end

def sandbox_oauth_client
  Moip2::Client.new :sandbox, sandbox_oauth
end<commit_msg>tests: force UTF-8 enconding for cassettes<commit_after>require "moip2"

require "vcr"
require "webmock"
require "simplecov"
SimpleCov.start

RSpec.configure do |config|
end
ENV["sandbox_url"] = "https://sandbox.moip.com.br"

VCR.configure do |c|
  c.cassette_library_dir = "vcr_cassettes"
  c.hook_into :webmock # or :fakeweb
  c.ignore_hosts "codeclimate.com"
  c.before_record do |i|
    i.response.body.force_encoding("UTF-8")
  end
end

# Helper methods
def sandbox_auth
  Moip2::Auth::Basic.new(
    "01010101010101010101010101010101",
    "ABABABABABABABABABABABABABABABABABABABAB",
  )
end

def sandbox_oauth
  Moip2::Auth::OAuth.new("9fdc242631454d4c95d82e27b4127394_v2")
end

def sandbox_client
  Moip2::Client.new(:sandbox, sandbox_auth)
end

def sandbox_oauth_client
  Moip2::Client.new :sandbox, sandbox_oauth
end
{'fraction_non_alphanumeric': 0.10917312661498708, 'fraction_numerical': 0.08139534883720931, 'mean_word_length': 5.823788546255507, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5481814', 'n_tokens_mistral': 730, 'n_tokens_neox': 649, 'n_words': 109}