<commit_before>require 'test_helper'

class DistanceFinderTest < Minitest::Test

  def setup
    @origin = "Slough"
    @destination = "Basingstoke"
    @route = DistanceFinder::Calculator.new(@origin, @destination)
  end

  def test_can_output_distance
    assert @route.distance
  end

  def test_can_output_duration
    assert @route.duration
  end

  def test_can_output_end_address
    assert @route.end_address.downcase.include?(@destination.downcase)
  end

  def test_can_output_start_address
    assert @route.start_address.downcase.include?(@origin.downcase)
  end


  def test_can_build_url
    url = "https://maps.googleapis.com/maps/api/directions/json?origin=#{@origin}&destination=#{@destination}"
    assert_equal @route.build_url, url
  end

  def test_can_parse_response
    refute @route.parse_response["status"].nil?
  end

  def test_can_get_response
    assert @route.parse_response
  end

end<commit_msg>Remove setup from calculator_test.rb<commit_after>require 'test_helper'

class DistanceFinderTest < Minitest::Test

  @@origin = "Slough"
  @@destination = "Basingstoke"
  @@route = DistanceFinder::Calculator.new(@@origin, @@destination)


  def test_can_output_distance
    assert @@route.distance
  end

  def test_can_output_duration
    assert @@route.duration
  end

  def test_can_output_end_address
    assert @@route.end_address.downcase.include?(@@destination.downcase)
  end

  def test_can_output_start_address
    assert @@route.start_address.downcase.include?(@@origin.downcase)
  end


  def test_can_build_url
    url = "https://maps.googleapis.com/maps/api/directions/json?origin=#{@@origin}&destination=#{@@destination}"
    assert_equal @@route.build_url, url
  end

  def test_can_parse_response
    refute @@route.parse_response["status"].nil?
  end

  def test_can_get_response
    assert @@route.get_response
  end

end
{'fraction_non_alphanumeric': 0.10010706638115632, 'fraction_numerical': 0.0, 'mean_word_length': 4.680851063829787, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3708244', 'n_tokens_mistral': 635, 'n_tokens_neox': 599, 'n_words': 107}