Sha256: c24bef5f270b09f690ceaffe69f07c6ca7d010a6395ed3882d07da23702e4be3

Contents?: true

Size: 501 Bytes

Versions: 20

Compression:

Stored size: 501 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

20 entries across 20 versions & 4 rubygems

Version Path
chronic-0.9.0 test/test_span.rb
Hokkaido-0.1.5 chronic/test/test_span.rb
Hokkaido-0.1.4 chronic/test/test_span.rb
Hokkaido-0.1.3 chronic/test/test_span.rb
Hokkaido-0.1.2 chronic/test/test_span.rb
Hokkaido-0.1.1 chronic/test/test_span.rb
Hokkaido-0.1.0 chronic/test/test_span.rb
Hokkaido-0.0.9 chronic/test/test_span.rb
Hokkaido-0.0.6 chronic/test/test_span.rb
Hokkaido-0.0.5 chronic/test/test_span.rb
Hokkaido-0.0.4 chronic/test/test_span.rb
chronic-0.8.0 test/test_span.rb
chronic-0.7.0 test/test_span.rb
chronic_2001-0.1.5 test/test_span.rb
chronic_2001-0.1.4 test/test_span.rb
chronic_2001-0.1.3 test/test_span.rb
chronic_2001-0.1.2 test/test_span.rb
chronic_2001-0.1.1 test/test_span.rb
chronic_2001-0.1.0 test/test_span.rb
chronic_2011-0.1.0 test/test_span.rb