<commit_before>require 'spec_helper'
require 'periods/constants'

describe Period do

  def new_period(start_date, end_date)
    described_class.new(start_date, end_date)
  end

  describe "==" do
    context "same period given" do<commit_msg>add spec example for passing Date and String to Period initializer<commit_after>require 'spec_helper'
require 'periods/constants'

describe Period do

  def new_period(start_date, end_date)
    described_class.new(start_date, end_date)
  end

  describe ".new" do
    it "accepts Date" do
      period = described_class.new(Date.new(2015,6,25), Date.new(2016,5,20))

      expect(period.start_date).to eq Date('25.06.2015')
      expect(period.end_date).to eq Date('20.05.2016')
    end

    it "accepts String" do
      period = described_class.new('25.06.2015', '20.05.2016')

      expect(period.start_date).to eq Date('25.06.2015')
      expect(period.end_date).to eq Date('20.05.2016')
    end
  end

  describe "==" do
    context "same period given" do
{'fraction_non_alphanumeric': 0.11676646706586827, 'fraction_numerical': 0.06187624750499002, 'mean_word_length': 3.8221153846153846, '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': '320974', 'n_tokens_mistral': 381, 'n_tokens_neox': 334, 'n_words': 81}