Sha256: 8b6f990737468513db7d7a020e16616b89d4727392996d1bd1f10f52dcb1f107

Contents?: true

Size: 502 Bytes

Versions: 11

Compression:

Stored size: 502 Bytes

Contents

require 'helper'

class TestSpan < TestCase

  def setup
    # Wed Aug 16 14:00:00 UTC 2006
    @now = Time.local(2006, 8, 16, 14, 0, 0, 0)
  end

  def test_span_width
    span = Chronic::Span.new(Time.local(2006, 8, 16, 0), Time.local(2006, 8, 17, 0))
    assert_equal((60 * 60 * 24), span.width)
  end

  def test_span_math
    s = Chronic::Span.new(1, 2)
    assert_equal 2, (s + 1).begin
    assert_equal 3, (s + 1).end
    assert_equal 0, (s - 1).begin
    assert_equal 1, (s - 1).end
  end

end

Version data entries

11 entries across 11 versions & 5 rubygems

Version Path
gitlab-chronic-0.10.6 test/test_span.rb
gitlab-chronic-0.10.5 test/test_span.rb
gitlab-chronic-0.10.4 test/test_span.rb
gitlab-chronic-0.10.3 test/test_span.rb
chronic-davispuh-0.10.2.v0.1da32066b3f46f2506b3471e39557497e34afa27 test/test_span.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_span.rb
chronic-mmlac-0.10.2.1 test/test_span.rb
chronic-0.10.2 test/test_span.rb
chronic-0.10.1 test/test_span.rb
chronic-0.10.0 test/test_span.rb
chronic-0.9.1 test/test_span.rb