Sha256: 4c37627be44f7e44120db9c2549e9e72724e2b8e2f30865cde30bad92d24cc85

Contents?: true

Size: 1.04 KB

Versions: 30

Compression:

Stored size: 1.04 KB

Contents

require 'helper'

class TestRepeaterSeason < TestCase

  def setup
    @now = Time.local(2006, 8, 16, 14, 0, 0, 0)
  end

  def test_next_future
    seasons = Chronic::RepeaterSeason.new(:season)
    seasons.start = @now

    next_season = seasons.next(:future)
    assert_equal Time.local(2006, 9, 23), next_season.begin
    assert_equal Time.local(2006, 12, 21), next_season.end
  end

  def test_next_past
    seasons = Chronic::RepeaterSeason.new(:season)
    seasons.start = @now

    last_season = seasons.next(:past)
    assert_equal Time.local(2006, 3, 20), last_season.begin
    assert_equal Time.local(2006, 6, 20), last_season.end
  end

  def test_this
    seasons = Chronic::RepeaterSeason.new(:season)
    seasons.start = @now

    this_season = seasons.this(:future)
    assert_equal Time.local(2006, 8, 17), this_season.begin
    assert_equal Time.local(2006, 9, 22), this_season.end

    this_season = seasons.this(:past)
    assert_equal Time.local(2006, 6, 21), this_season.begin
    assert_equal Time.local(2006, 8, 16), this_season.end
  end

end

Version data entries

30 entries across 30 versions & 7 rubygems

Version Path
gitlab-chronic-0.10.6 test/test_repeater_season.rb
gitlab-chronic-0.10.5 test/test_repeater_season.rb
gitlab-chronic-0.10.4 test/test_repeater_season.rb
gitlab-chronic-0.10.3 test/test_repeater_season.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_season.rb
chronic-mmlac-0.10.2.1 test/test_repeater_season.rb
chronic-0.10.2 test/test_repeater_season.rb
chronic-0.10.1 test/test_repeater_season.rb
chronic-0.10.0 test/test_repeater_season.rb
chronic-0.9.1 test/test_repeater_season.rb
chronic-0.9.0 test/test_repeater_season.rb
Hokkaido-0.1.5 chronic/test/test_repeater_season.rb
Hokkaido-0.1.4 chronic/test/test_repeater_season.rb
Hokkaido-0.1.3 chronic/test/test_repeater_season.rb
Hokkaido-0.1.2 chronic/test/test_repeater_season.rb
Hokkaido-0.1.1 chronic/test/test_repeater_season.rb
Hokkaido-0.1.0 chronic/test/test_repeater_season.rb
Hokkaido-0.0.9 chronic/test/test_repeater_season.rb
Hokkaido-0.0.6 chronic/test/test_repeater_season.rb
Hokkaido-0.0.5 chronic/test/test_repeater_season.rb