<commit_before>require 'spec_helper'

feature 'recurring' do
  describe 'extract_r_tokens' do
    it { Xtdo.extract_recur_tokens('1d T1').should == ['1', 'd', nil, 'T1'] }
    it { Xtdo.extract_recur_tokens('1w,thu T1').should == ['1', 'w', 'thu', 'T1'] }
    it { Xtdo.extract_recur_tokens('1m,2 T1').should == ['1', 'm', '2', 'T1'] }
    it { Xtdo.extract_recur_tokens('1m,20 T1').should == ['1', 'm', '20', 'T1'] }
  end

  describe 'starting day' do
    let(:today) { Date.new(2010,11,22) } # Monday

    it { Xtdo.calculate_starting_day(today, 1, 'd').should == today + 1 }
    it { Xtdo.calculate_starting_day(today, 1, 'w', 'mon').should == today + 7}
    it { Xtdo.calculate_starting_day(today, 1, 'w', 'tue').should == today + 1}
    it { Xtdo.calculate_starting_day(today, 1, 'w', 'sun').should == today + 6}
    it { Xtdo.calculate_starting_day(today, 1, 'w', '0').should == nil }
  end

    let(:today) { Date.new(2010,11,17) } # Monday
  scenario 'daily' do

    time_travel today
    t('r a 1d T1')

    time_travel today + 1
    t('l').should have_task('T1')
    t('b 1 T1')
    t('l').should_not have_task('T1')
    t('d T1')
    t('l').should_not have_task('T1')

    time_travel today + 2
    t('l').should have_task('T1')
    t('d T1')

    time_travel today + 4
    t('l').should have_task('T1')
  end

  scenario 'remove' do
    t('r a 1d T1')
    t('r d T1')
    t('l a').should_not have_task('T1')
  end

  scenario 'weekly' do
    time_travel today
    t('r a 1w,thu T1')
<commit_msg>Corrected erroneous remove recurring spec, it now fails, as it should<commit_after>require 'spec_helper'

feature 'recurring' do
  describe 'extract_r_tokens' do
    it { Xtdo.extract_recur_tokens('1d T1').should == ['1', 'd', nil, 'T1'] }
    it { Xtdo.extract_recur_tokens('1w,thu T1').should == ['1', 'w', 'thu', 'T1'] }
    it { Xtdo.extract_recur_tokens('1m,2 T1').should == ['1', 'm', '2', 'T1'] }
    it { Xtdo.extract_recur_tokens('1m,20 T1').should == ['1', 'm', '20', 'T1'] }
  end

  describe 'starting day' do
    let(:today) { Date.new(2010,11,22) } # Monday

    it { Xtdo.calculate_starting_day(today, 1, 'd').should == today + 1 }
    it { Xtdo.calculate_starting_day(today, 1, 'w', 'mon').should == today + 7}
    it { Xtdo.calculate_starting_day(today, 1, 'w', 'tue').should == today + 1}
    it { Xtdo.calculate_starting_day(today, 1, 'w', 'sun').should == today + 6}
    it { Xtdo.calculate_starting_day(today, 1, 'w', '0').should == nil }
  end

    let(:today) { Date.new(2010,11,17) } # Monday
  scenario 'daily' do

    time_travel today
    t('r a 1d T1')

    time_travel today + 1
    t('l').should have_task('T1')
    t('b 1 T1')
    t('l').should_not have_task('T1')
    t('d T1')
    t('l').should_not have_task('T1')

    time_travel today + 2
    t('l').should have_task('T1')
    t('d T1')

    time_travel today + 4
    t('l').should have_task('T1')
  end

  scenario 'remove' do
    time_travel today
    t('r a 1d T1')
    t('r d T1')
    time_travel today + 1
    t('l a').should_not have_task('T1')
  end

  scenario 'weekly' do
    time_travel today
    t('r a 1w,thu T1')

{'fraction_non_alphanumeric': 0.18942307692307692, 'fraction_numerical': 0.04391025641025641, 'mean_word_length': 3.340751043115438, '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': '2094548', 'n_tokens_mistral': 1379, 'n_tokens_neox': 1265, 'n_words': 295}