<commit_before>require 'spec_helper'
describe StreetNames::Parser do
  describe 'parsing' do
    let (:street_parser) { StreetNames::Parser.new }

    before(:all) { street_parser.load_cities }

    it 'load streets from spreadsheet' do
      street_parser.streets.map(&:to_json).should include "{\"name\":\"<NAME>\",\"postcode\":8041,\"area\":\"Pafos\"}"
    end

    context '#finders' do
      it 'find streets by postcode' do
        street_parser.find_by_postcode(8020).map(&:to_json).should include "{\"name\":\"Dimosthenous Georgiou\",\"postcode\":8020,\"area\":\"Pafos\"}", "{\"name\":\"Ellados Avenue\",\"postcode\":8020,\"area\":\"Pafos\"}"
      end

      it 'find street names by  postcode' do
        address = { :name => "Dimosthenous Georgiou", :postcode => 8020, :area => "Pafos"}

        street_parser.find_by_street_name("Dimosthenous Georgiou").map(&:to_hash).should include address
      end
    end
  end

end<commit_msg>tidy up specs<commit_after>require 'spec_helper'
describe StreetNames::Parser do
  describe 'parsing' do
    let (:street_parser) { StreetNames::Parser.new }

    before(:all) { street_parser.load_cities }

    it 'load streets from spreadsheet' do
      street = { :name => "<NAME>", :postcode => 8041, :area => "Pafos"}
      street_parser.streets.map(&:to_json).should include street.to_json
    end

    context '#finders' do
      it 'find streets by postcode' do
        street = { :name => "Dimosthenous Georgiou", :postcode => 8020, :area => "Pafos"}

        street_parser.find_by_postcode(8020).map(&:to_json).should include street.to_json
      end

      it 'find street  by street name' do
        address = { :name => "Dimosthenous Georgiou", :postcode => 8020, :area => "Pafos"}

        street_parser.find_by_street_name("Dimosthenous Georgiou").map(&:to_json).should include address.to_json
      end
    end
  end

end
{'fraction_non_alphanumeric': 0.15159574468085107, 'fraction_numerical': 0.019148936170212766, 'mean_word_length': 3.5544794188861983, 'pattern_counts': {'":': 9, '<': 5, '<?xml version=': 0, '>': 17, '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': '6321632', 'n_tokens_mistral': 658, 'n_tokens_neox': 615, 'n_words': 137}