2011-06-23 18:11:55 -04:00
|
|
|
require File.expand_path('../helper', __FILE__)
|
2009-10-02 15:07:55 -04:00
|
|
|
|
2011-06-23 18:11:55 -04:00
|
|
|
class TestRakeEarlyTime < Rake::TestCase
|
2009-10-02 15:07:55 -04:00
|
|
|
def test_create
|
|
|
|
early = Rake::EarlyTime.instance
|
|
|
|
assert early <= Time.now
|
|
|
|
assert early < Time.now
|
|
|
|
assert early != Time.now
|
|
|
|
assert Time.now > early
|
|
|
|
assert Time.now >= early
|
|
|
|
assert Time.now != early
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_equality
|
|
|
|
early = Rake::EarlyTime.instance
|
|
|
|
assert_equal early, early, "two early times should be equal"
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_original_time_compare_is_not_messed_up
|
|
|
|
t1 = Time.mktime(1970, 1, 1, 0, 0, 0)
|
|
|
|
t2 = Time.now
|
|
|
|
assert t1 < t2
|
|
|
|
assert t2 > t1
|
|
|
|
assert t1 == t1
|
2011-05-15 07:55:52 -04:00
|
|
|
assert t2 == t2
|
2009-10-02 15:07:55 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_to_s
|
|
|
|
assert_equal "<EARLY TIME>", Rake::EARLY.to_s
|
|
|
|
end
|
|
|
|
end
|