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

describe IceCube::Schedule, 'to_s' do

  before :each do
    I18n.locale = :de
  end

  it 'should represent its start time by default' do
    t0 = Time.local(2013, 2, 14)
    IceCube::Schedule.new(t0).to_s.should == '14. Februar 2013'
  end

  it 'should have a useful base to_s representation for a secondly rule' do
    IceCube::Rule.secondly.to_s.should == 'Sekündlich'
    IceCube::Rule.secondly(2).to_s.should == 'Alle 2 Sekunden'
  end

  it 'should have a useful base to_s representation for a minutely rule' do
    IceCube::Rule.minutely.to_s.should == 'Minütlich'
    IceCube::Rule.minutely(2).to_s.should == 'Alle 2 Minuten'
  end

  it 'should have a useful base to_s representation for a hourly rule' do
    IceCube::Rule.hourly.to_s.should == 'Stündlich'
    IceCube::Rule.hourly(2).to_s.should == 'Alle 2 Stunden'
  end

  it 'should have a useful base to_s representation for a daily rule' do
    IceCube::Rule.daily.to_s.should == 'Täglich'
    IceCube::Rule.daily(2).to_s.should == 'Alle 2 Tage'
  end

  it 'should have a useful base to_s representation for a weekly rule' do
    IceCube::Rule.weekly.to_s.should == 'Wöchentlich'
    IceCube::Rule.weekly(2).to_s.should == 'Alle 2 Wochen'
  end

  it 'should have a useful base to_s representation for a monthly rule' do
    IceCube::Rule.monthly.to_s.should == 'Monatlich'
    IceCube::Rule.monthly(2).to_s.should == 'Alle 2 Monate'
  end

  it 'should have a useful base to_s representation for a yearly rule' do
    IceCube::Rule.yearly.to_s.should == 'Jährlich'
    IceCube::Rule.yearly(2).to_s.should == 'Alle 2 Jahre'
  end

  it 'should work with various sentence types properly' do
    IceCube::Rule.weekly.to_s.should == 'Wöchentlich'
    IceCube::Rule.weekly.day(:monday).to_s.should == 'Wöchentlich: Montags'
    IceCube::Rule.weekly.day(:monday, :tuesday).to_s.should == 'Wöchentlich: Montags und Dienstags'
    IceCube::Rule.weekly.day(:monday, :tuesday, :wednesday).to_s.should == 'Wöchentlich: Montags, Dienstags, und Mittwochs'
  end

  it 'should show saturday and sunday as weekends' do
    IceCube::Rule.weekly.day(:saturday, :sunday).to_s.should == 'Wöchentlich an Wochenenden'
  end

  it 'should not show saturday and sunday as weekends when other days are present also' do
    IceCube::Rule.weekly.day(:sunday, :monday, :saturday).to_s.should ==
      'Wöchentlich: Sonntags, Montags, und Samstags'
  end

  it 'should reorganize days to be in order' do
    IceCube::Rule.weekly.day(:tuesday, :monday).to_s.should ==
      'Wöchentlich: Montags und Dienstags'
  end

  it 'should show weekdays as such' do
    IceCube::Rule.weekly.day(
      :monday, :tuesday, :wednesday,
      :thursday, :friday
    ).to_s.should == 'Wöchentlich an Wochentagen'
  end

  it 'should not show weekdays as such when a weekend day is present' do
    IceCube::Rule.weekly.day(
      :sunday, :monday, :tuesday, :wednesday,
      :thursday, :friday
    ).to_s.should == 'Wöchentlich: Sonntags, Montags, Dienstags, Mittwochs, Donnerstags, und Freitags'
  end

  it 'should show start time for an empty schedule' do
    schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
    schedule.to_s.should == "20. März 2010"
  end<commit_msg>Add sad space before colon<commit_after>
require File.dirname(__FILE__) + '/../spec_helper'

describe IceCube::Schedule, 'to_s' do

  before :each do
    I18n.locale = :de
  end

  it 'should represent its start time by default' do
    t0 = Time.local(2013, 2, 14)
    IceCube::Schedule.new(t0).to_s.should == '14. Februar 2013'
  end

  it 'should have a useful base to_s representation for a secondly rule' do
    IceCube::Rule.secondly.to_s.should == 'Sekündlich'
    IceCube::Rule.secondly(2).to_s.should == 'Alle 2 Sekunden'
  end

  it 'should have a useful base to_s representation for a minutely rule' do
    IceCube::Rule.minutely.to_s.should == 'Minütlich'
    IceCube::Rule.minutely(2).to_s.should == 'Alle 2 Minuten'
  end

  it 'should have a useful base to_s representation for a hourly rule' do
    IceCube::Rule.hourly.to_s.should == 'Stündlich'
    IceCube::Rule.hourly(2).to_s.should == 'Alle 2 Stunden'
  end

  it 'should have a useful base to_s representation for a daily rule' do
    IceCube::Rule.daily.to_s.should == 'Täglich'
    IceCube::Rule.daily(2).to_s.should == 'Alle 2 Tage'
  end

  it 'should have a useful base to_s representation for a weekly rule' do
    IceCube::Rule.weekly.to_s.should == 'Wöchentlich'
    IceCube::Rule.weekly(2).to_s.should == 'Alle 2 Wochen'
  end

  it 'should have a useful base to_s representation for a monthly rule' do
    IceCube::Rule.monthly.to_s.should == 'Monatlich'
    IceCube::Rule.monthly(2).to_s.should == 'Alle 2 Monate'
  end

  it 'should have a useful base to_s representation for a yearly rule' do
    IceCube::Rule.yearly.to_s.should == 'Jährlich'
    IceCube::Rule.yearly(2).to_s.should == 'Alle 2 Jahre'
  end

  it 'should work with various sentence types properly' do
    IceCube::Rule.weekly.to_s.should == 'Wöchentlich'
    IceCube::Rule.weekly.day(:monday).to_s.should == 'Wöchentlich : Montags'
    IceCube::Rule.weekly.day(:monday, :tuesday).to_s.should == 'Wöchentlich : Montags und Dienstags'
    IceCube::Rule.weekly.day(:monday, :tuesday, :wednesday).to_s.should == 'Wöchentlich : Montags, Dienstags, und Mittwochs'
  end

  it 'should show saturday and sunday as weekends' do
    IceCube::Rule.weekly.day(:saturday, :sunday).to_s.should == 'Wöchentlich an Wochenenden'
  end

  it 'should not show saturday and sunday as weekends when other days are present also' do
    IceCube::Rule.weekly.day(:sunday, :monday, :saturday).to_s.should ==
      'Wöchentlich : Sonntags, Montags, und Samstags'
  end

  it 'should reorganize days to be in order' do
    IceCube::Rule.weekly.day(:tuesday, :monday).to_s.should ==
      'Wöchentlich : Montags und Dienstags'
  end

  it 'should show weekdays as such' do
    IceCube::Rule.weekly.day(
      :monday, :tuesday, :wednesday,
      :thursday, :friday
    ).to_s.should == 'Wöchentlich an Wochentagen'
  end

  it 'should not show weekdays as such when a weekend day is present' do
    IceCube::Rule.weekly.day(
      :sunday, :monday, :tuesday, :wednesday,
      :thursday, :friday
    ).to_s.should == 'Wöchentlich : Sonntags, Montags, Dienstags, Mittwochs, Donnerstags, und Freitags'
  end

  it 'should show start time for an empty schedule' do
    schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
    schedule.to_s.should == "20. März 2010"
  end
{'fraction_non_alphanumeric': 0.11748592299497794, 'fraction_numerical': 0.013392177750722873, 'mean_word_length': 3.7657722987672226, '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': '6933969', 'n_tokens_mistral': 2511, 'n_tokens_neox': 2404, 'n_words': 655}