Sha256: 857406e2cb04abd8d0c04533297bbd2c5898f23fe3380c5b2401673bd50871e8

Contents?: true

Size: 1.03 KB

Versions: 30

Compression:

Stored size: 1.03 KB

Contents

require 'helper'

class TestRepeaterMinute < TestCase

  def setup
    @now = Time.local(2008, 6, 25, 7, 15, 30, 0)
  end

  def test_next_future
    minutes = Chronic::RepeaterMinute.new(:minute)
    minutes.start = @now

    next_minute = minutes.next(:future)
    assert_equal Time.local(2008, 6, 25, 7, 16), next_minute.begin
    assert_equal Time.local(2008, 6, 25, 7, 17), next_minute.end

    next_next_minute = minutes.next(:future)
    assert_equal Time.local(2008, 6, 25, 7, 17), next_next_minute.begin
    assert_equal Time.local(2008, 6, 25, 7, 18), next_next_minute.end
  end

  def test_next_past
    minutes = Chronic::RepeaterMinute.new(:minute)
    minutes.start = @now

    prev_minute = minutes.next(:past)
    assert_equal Time.local(2008, 6, 25, 7, 14), prev_minute.begin
    assert_equal Time.local(2008, 6, 25, 7, 15), prev_minute.end

    prev_prev_minute = minutes.next(:past)
    assert_equal Time.local(2008, 6, 25, 7, 13), prev_prev_minute.begin
    assert_equal Time.local(2008, 6, 25, 7, 14), prev_prev_minute.end
  end
end

Version data entries

30 entries across 30 versions & 7 rubygems

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