<commit_before>require 'spec_helper'

describe WeatherMan do
  describe ".key_for" do
    it "returns a key for a given zip code and datetime" do
      key = WeatherMan.key_for(10001, Time.zone.parse('January 1, 2015'))
      expect(key).to eq "outdoor_temp_for_10001_on_2015-01-01"
    end

    it "includes the hour if datetime is today" do
      datetime = Time.zone.now
      key = WeatherMan.key_for(10001, datetime)
      expect(key).to eq "outdoor_temp_for_10001_on_2015-03-01H00"
    end
  end

  describe ".current_outdoor_temp" do<commit_msg>Make test runs more consistent by controlling time more precisely<commit_after>require 'spec_helper'

describe WeatherMan do
  before(:all) do
    Timecop.travel(Time.zone.parse('March 1, 2015 at 12am'))
  end

  after(:all) do
    Timecop.return
  end

  describe ".key_for" do
    it "returns a key for a given zip code and datetime" do
      key = WeatherMan.key_for(10001, Time.zone.parse('January 1, 2015'))
      expect(key).to eq "outdoor_temp_for_10001_on_2015-01-01"
    end

    it "includes the hour if datetime is today" do
      time = Time.zone.parse('March 1, 2015 at 12am')
      key = WeatherMan.key_for(10001, time)
      expect(key).to eq "outdoor_temp_for_10001_on_2015-03-01H00"
    end
  end

  describe ".current_outdoor_temp" do
{'fraction_non_alphanumeric': 0.09202453987730061, 'fraction_numerical': 0.07668711656441718, 'mean_word_length': 3.469178082191781, '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': '106917', 'n_tokens_mistral': 525, 'n_tokens_neox': 435, 'n_words': 126}