test/time_0_test.rb in rufus-scheduler-1.0.5 vs test/time_0_test.rb in rufus-scheduler-1.0.6
- old
+ new
@@ -15,73 +15,73 @@
# testing otime
#
class Time0Test < Test::Unit::TestCase
- #def setup
- #end
+ #def setup
+ #end
- #def teardown
- #end
+ #def teardown
+ #end
- def _test_to_iso_date
- #
- # well... this test is not timezone friendly...
- # commented out thus...
+ def _test_to_iso_date
+ #
+ # well... this test is not timezone friendly...
+ # commented out thus...
- t = 1169019813.93468
+ t = 1169019813.93468
- s = Rufus.to_iso8601_date(t)
- puts s
+ s = Rufus.to_iso8601_date(t)
+ puts s
- assert_equal(
- "2007-01-17 02:43:33-0500",
- Rufus.to_iso8601_date(t),
- "conversion to iso8601 date failed")
+ assert_equal(
+ "2007-01-17 02:43:33-0500",
+ Rufus.to_iso8601_date(t),
+ "conversion to iso8601 date failed")
- d = Rufus.to_ruby_time(s)
+ d = Rufus.to_ruby_time(s)
- #puts d.to_s
+ #puts d.to_s
- assert_equal(
- "2007-01-17T02:43:33-0500",
- d.to_s,
- "iso8601 date parsing failed")
- end
+ assert_equal(
+ "2007-01-17T02:43:33-0500",
+ d.to_s,
+ "iso8601 date parsing failed")
+ end
- def test_is_digit
+ def test_is_digit
- for i in 0...9
- si = "#{i}"
- assert \
- Rufus::is_digit?(si),
- "'#{si}' should be a digit"
- end
-
- assert \
- (not Rufus::is_digit?(1)),
- "the integer 1 is not a character digit"
- assert \
- (not Rufus::is_digit?("a")),
- "the character 'a' is not a character digit"
+ for i in 0...9
+ si = "#{i}"
+ assert \
+ Rufus::is_digit?(si),
+ "'#{si}' should be a digit"
end
- def test_parse_time_string
+ assert \
+ (not Rufus::is_digit?(1)),
+ "the integer 1 is not a character digit"
+ assert \
+ (not Rufus::is_digit?("a")),
+ "the character 'a' is not a character digit"
+ end
- pts "500", 0.5
- pts "1000", 1.0
- pts "1h", 3600.0
- pts "1h10s", 3610.0
- pts "1w2d", 777600.0
- end
+ def test_parse_time_string
- protected
+ pts "500", 0.5
+ pts "1000", 1.0
+ pts "1h", 3600.0
+ pts "1h10s", 3610.0
+ pts "1w2d", 777600.0
+ end
- def pts (time_string, seconds)
+ protected
- assert_equal(
- seconds,
- Rufus::parse_time_string(time_string),
- "'#{time_string}' did not map to #{seconds} seconds")
- end
+ def pts (time_string, seconds)
+
+ assert_equal(
+ seconds,
+ Rufus::parse_time_string(time_string),
+ "'#{time_string}' did not map to #{seconds} seconds")
+ end
end