tighten up Hub and add comments
[god.git] / test / test_sugar.rb
blob911a77f4fda19db84e9337babc35f4e1ba63117d
1 require File.dirname(__FILE__) + '/helper'
3 class TestSugar < Test::Unit::TestCase
4   def test_seconds
5     assert_equal 1, 1.seconds
6     assert_equal 1, 1.second
7   end
8   
9   def test_minutes
10     assert_equal 60, 1.minutes
11     assert_equal 60, 1.minute
12   end
13   
14   def test_hours
15     assert_equal 3600, 1.hours
16     assert_equal 3600, 1.hour
17   end
18   
19   def test_days
20     assert_equal 86400, 1.days
21     assert_equal 86400, 1.day
22   end
23   
24   def test_kilobytes
25     assert_equal 1, 1.kilobytes
26     assert_equal 1, 1.kilobyte
27   end
28   
29   def test_megabytes
30     assert_equal 1024, 1.megabytes
31     assert_equal 1024, 1.megabyte
32   end
33   
34   def test_gigabytes
35     assert_equal 1024 ** 2, 1.gigabytes
36     assert_equal 1024 ** 2, 1.gigabyte
37   end
38   
39   def test_percent
40     assert_equal 1, 1.percent
41   end
42 end