<commit_before>require 'helper'

class TestDates < Test::Unit::TestCase

  context "a Date" do

    should "be avilable as a DSL method on Number" do
      Prunr::Date.extend_fixnum
      assert 1.year.is_a?(Prunr::Date::Year)
      assert 1.month.is_a?(Prunr::Date::Month)
      assert 1.week.is_a?(Prunr::Date::Week)
      assert 1.day.is_a?(Prunr::Date::Day)
      assert 1.day.amount == 1
    end

  end

end
<commit_msg>added more tests for timeframes<commit_after>require 'helper'

class TestDates < Test::Unit::TestCase

  def setup
      Prunr::Timeframe.extend_fixnum
  end

  context "a Date" do
    should "be avilable as a DSL method on Number" do
      assert 1.year.is_a?(Prunr::Timeframe::Year)
      assert 1.month.is_a?(Prunr::Timeframe::Month)
      assert 1.week.is_a?(Prunr::Timeframe::Week)
      assert 1.day.is_a?(Prunr::Timeframe::Day)
      assert 1.day.amount == 1
    end

    should "always contain future dates" do
      assert 1.day.contains(DateTime.now + 3600)
      assert 1.week.contains(DateTime.now + 3600)
      assert 1.month.contains(DateTime.now + 3600)
      assert 1.year.contains(DateTime.now + 3600)
    end
  end

  context "a Day" do
    should "contain some dates" do
      assert 1.day.contains(DateTime.now)
      assert 1.day.contains(DateTime.now - 3600)
      assert !1.day.contains(DateTime.now - 3600*24*2)
    end
  end

  context "a Week" do
    should "contain some dates" do
      assert 1.week.contains(DateTime.now)
      assert 1.week.contains(DateTime.now - 3600)
      assert !1.week.contains(DateTime.now - 3600*24*8)
    end
  end

  context "a Month" do
    should "contain some dates" do
      assert 1.month.contains(DateTime.now)
      assert 1.month.contains(DateTime.now - 3600)
      assert !1.month.contains(DateTime.now - 3600*24*33)
    end
  end

  context "a Year" do
    should "contain some dates" do
      assert 1.year.contains(DateTime.now)
      assert 1.year.contains(DateTime.now - 3600)
      assert !1.year.contains(DateTime.now - 3600*24*300)
    end
  end

end

{'fraction_non_alphanumeric': 0.1151219512195122, 'fraction_numerical': 0.04439024390243902, 'mean_word_length': 2.8625235404896423, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2533130', 'n_tokens_mistral': 782, 'n_tokens_neox': 710, 'n_words': 170}