<commit_before>require_relative '../dist_calc'

describe Coordinate do

  let(:latitude)  { 0 }
  let(:longitude) { 1 }
  subject { Coordinate.new(latitude, longitude) }

  describe '#to_unescaped_query_param' do
    context 'when serializing the object' do
      it 'prints both latitude and longitude' do
        expect(subject.to_unescaped_query_param).to eq('0, 1')
      end
    end
  end

  describe '#=' do
    context 'when comparing the object' do
      it 'succeeds when given another Coordinate with the same lat and long' do
        expect(subject).to eq(subject.clone)
      end

      it 'fails when given a Coordinate with a different lat and long' do
        expect(subject).not_to eq(Coordinate.new(subject.latitude+1, 0))
      end
    end
  end

  let(:seattle)   { Coordinate.new(47.606209, -122.332071) }
  let(:sunnyvale) { Coordinate.new(37.368830, -122.03635) }
  let(:austin)    { Coordinate.new(30.267153, -97.743061) }
  let(:nyc)       { Coordinate.new(40.714353, -74.005973) }
  let(:moscow)    { Coordinate.new(55.755826, 37.6173) }

  describe '#distance' do<commit_msg>Fix typo in test name<commit_after>require_relative '../dist_calc'

describe Coordinate do

  let(:latitude)  { 0 }
  let(:longitude) { 1 }
  subject { Coordinate.new(latitude, longitude) }

  describe '#to_unescaped_query_param' do
    context 'when serializing the object' do
      it 'prints both latitude and longitude' do
        expect(subject.to_unescaped_query_param).to eq('0, 1')
      end
    end
  end

  describe '#==' do
    context 'when comparing the object' do
      it 'succeeds when given another Coordinate with the same lat and long' do
        expect(subject).to eq(subject.clone)
      end

      it 'fails when given a Coordinate with a different lat and long' do
        expect(subject).not_to eq(Coordinate.new(subject.latitude+1, 0))
      end
    end
  end

  let(:seattle)   { Coordinate.new(47.606209, -122.332071) }
  let(:sunnyvale) { Coordinate.new(37.368830, -122.03635) }
  let(:austin)    { Coordinate.new(30.267153, -97.743061) }
  let(:nyc)       { Coordinate.new(40.714353, -74.005973) }
  let(:moscow)    { Coordinate.new(55.755826, 37.6173) }

  describe '#distance' do
{'fraction_non_alphanumeric': 0.11714156490275893, 'fraction_numerical': 0.07688828584350972, 'mean_word_length': 3.1345794392523363, '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': '4501883', 'n_tokens_mistral': 877, 'n_tokens_neox': 753, 'n_words': 193}