Sha256: b16ff794c6a1cf240b385f76e52a09b519607f42525d43bce43ee6196b25d97e

Contents?: true

Size: 539 Bytes

Versions: 21

Compression:

Stored size: 539 Bytes

Contents

require 'chronic'
require 'test/unit'

class TestSpan < Test::Unit::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

21 entries across 21 versions & 10 rubygems

Version Path
blakechambers-chronic-0.3.0.2 test/test_Span.rb
jdl-chronic-0.3.0.1 test/test_Span.rb
lmarlow-chronic-0.3.0.1 test/test_Span.rb
mojombo-chronic-0.3.0 test/test_Span.rb
moorage-chronic-0.3.0 test/test_Span.rb
rgm-chronic-0.3.1 test/test_Span.rb
sethwalker-chronic-0.3.0 test/test_Span.rb
jdl-chronic-0.3.0.2 test/test_Span.rb
caleb-chronic-0.3.0 test/test_Span.rb
pyrat-chronic-0.3.1 test/test_Span.rb
chronic-0.1.0 test/test_Span.rb
chronic-0.1.1 test/test_Span.rb
chronic-0.1.4 test/test_Span.rb
chronic-0.1.3 test/test_Span.rb
chronic-0.2.1 test/test_Span.rb
chronic-0.1.6 test/test_Span.rb
chronic-0.1.2 test/test_Span.rb
chronic-0.2.0 test/test_Span.rb
chronic-0.2.2 test/test_Span.rb
chronic-0.1.5 test/test_Span.rb