PageRenderTime 326ms CodeModel.GetById 319ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/Ruby/lib/ruby/gems/1.8/gems/rake-0.9.2/test/test_rake_early_time.rb

http://github.com/agross/netopenspace
Ruby | 31 lines | 27 code | 4 blank | 0 comment | 4 complexity | 4d3324d7e2d177f3bfada37eeb804ef4 MD5 | raw file
 1require File.expand_path('../helper', __FILE__)
 2
 3class TestRakeEarlyTime < Rake::TestCase
 4  def test_create
 5    early = Rake::EarlyTime.instance
 6    assert early <= Time.now
 7    assert early < Time.now
 8    assert early != Time.now
 9    assert Time.now > early
10    assert Time.now >= early
11    assert Time.now != early
12  end
13
14  def test_equality
15    early = Rake::EarlyTime.instance
16    assert_equal early, early, "two early times should be equal"
17  end
18
19  def test_original_time_compare_is_not_messed_up
20    t1 = Time.mktime(1970, 1, 1, 0, 0, 0)
21    t2 = Time.now
22    assert t1 < t2
23    assert t2 > t1
24    assert t1 == t1
25    assert t2 == t2
26  end
27
28  def test_to_s
29    assert_equal "<EARLY TIME>", Rake::EARLY.to_s
30  end
31end