<commit_before>require File.dirname(__FILE__) + '/../spec_helper'

describe Holiday, " when calculating due date" do
    fixtures :holidays

    def due_date(ymd) 
        return Holiday.due_date_from(Date.strptime(ymd)).strftime("%F")
    end

    it "handles no holidays" do
      due_date('2008-10-01').should == '2008-10-29'
    end

    it "handles non leap years" do
      due_date('2007-02-01').should == '2007-03-01'
    end

    it "handles leap years" do
      due_date('2008-02-01').should == '2008-02-29'
    end

    it "handles Thursday start" do
      due_date('2009-03-12').should == '2009-04-14'
    end

    it "handles Friday start" do
      due_date('2009-03-13').should == '2009-04-15'
    end

    it "handles Saturday start" do
      due_date('2009-03-14').should == '2009-04-16'
    end

    it "handles Sunday start" do
      due_date('2009-03-15').should == '2009-04-16'
    end

    it "handles Monday start" do
      due_date('2009-03-16').should == '2009-04-16' 
    end

end

<commit_msg>Test that Time objects DTRT<commit_after>require File.dirname(__FILE__) + '/../spec_helper'

describe Holiday, " when calculating due date" do
    fixtures :holidays

    def due_date(ymd) 
        return Holiday.due_date_from(Date.strptime(ymd)).strftime("%F")
    end

    it "handles no holidays" do
      due_date('2008-10-01').should == '2008-10-29'
    end

    it "handles non leap years" do
      due_date('2007-02-01').should == '2007-03-01'
    end

    it "handles leap years" do
      due_date('2008-02-01').should == '2008-02-29'
    end

    it "handles Thursday start" do
      due_date('2009-03-12').should == '2009-04-14'
    end

    it "handles Friday start" do
      due_date('2009-03-13').should == '2009-04-15'
    end

    it "handles Saturday start" do
      due_date('2009-03-14').should == '2009-04-16'
    end

    it "handles Sunday start" do
      due_date('2009-03-15').should == '2009-04-16'
    end

    it "handles Monday start" do
      due_date('2009-03-16').should == '2009-04-16' 
    end

    it "handles Time objects" do
      Holiday.due_date_from(Time.utc(2009, 03, 16, 12, 0, 0)).strftime('%F').should == '2009-04-16' 
    end

end


{'fraction_non_alphanumeric': 0.14956680346557227, 'fraction_numerical': 0.12585499316005472, 'mean_word_length': 2.567479674796748, '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': '2983925', 'n_tokens_mistral': 988, 'n_tokens_neox': 777, 'n_words': 183}