<commit_before># coding: utf-8

require "rubygems"
gem "minitest"
require "minitest/pride"
require "minitest/autorun"

require "json"
require_relative "../lib/http_client"

module Minitest
  class Test
    def self.test(name, &block)
      define_method("test_#{name.gsub(" ", " ")}", &block)
    end
  end
end

class HttpClientTest < Minitest::Test
  attr_reader :client

  def setup
    @client = HttpClient.new
  end

  test "GET request with params in uri" do
    response = client.get("http://httpbin.org/get?foo=bar")
    assert_equal Hash("foo" => "bar"), response.json_body["args"]
  end

  test "GET request with params in options" do
    response = client.get("http://httpbin.org/get", :params => { :foo => "bar" })
    assert_equal Hash("foo" => "bar"), response.json_body["args"]<commit_msg>Fixed tests to work with bundler <3 Travis<commit_after># coding: utf-8

require "rubygems"
require "bundler/setup"
require "minitest/pride"
require "minitest/autorun"

require "json"
require_relative "../lib/http_client"

module Minitest
  class Test
    def self.test(name, &block)
      define_method("test_#{name.gsub(" ", " ")}", &block)
    end
  end
end

class HttpClientTest < Minitest::Test
  attr_reader :client

  def setup
    @client = HttpClient.new(:socket_timeout => 5000, :connect_timeout => 5000, :max_retries => 2)
  end

  test "GET request with params in uri" do
    response = client.get("http://httpbin.org/get?foo=bar")
    assert_equal Hash("foo" => "bar"), response.json_body["args"]
  end

  test "GET request with params in options" do
    response = client.get("http://httpbin.org/get", :params => { :foo => "bar" })
    assert_equal Hash("foo" => "bar"), response.json_body["args"]
{'fraction_non_alphanumeric': 0.1487747957992999, 'fraction_numerical': 0.007001166861143524, 'mean_word_length': 4.089020771513353, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 14, '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': '4859383', 'n_tokens_mistral': 595, 'n_tokens_neox': 578, 'n_words': 149}