1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/rake/test_earlytime.rb
nobu 746fe8af5a * test/rake: get rid of name collision.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-03 14:47:46 +00:00

33 lines
767 B
Ruby

require 'test/unit'
require 'rake'
class Rake::TestEarlyTime < Test::Unit::TestCase
def test_create
early = Rake::EarlyTime.instance
time = Time.mktime(1970, 1, 1, 0, 0, 0)
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
assert t2 == t2
end
def test_to_s
assert_equal "<EARLY TIME>", Rake::EARLY.to_s
end
end