add lambda condition, sugar, and docs
[god.git] / test / test_sugar.rb
blob5daa02ca21f63641591965a52e3ee6649ed8a8b7
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_bytes
25     assert_equal 1, 1.bytes
26     assert_equal 1, 1.byte
27   end
28   
29   def test_kilobytes
30     assert_equal 1024, 1.kilobytes
31     assert_equal 1024, 1.kilobyte
32   end
33   
34   def test_megabytes
35     assert_equal 1024 ** 2, 1.megabytes
36     assert_equal 1024 ** 2, 1.megabyte
37   end
38   
39   def test_gigabytes
40     assert_equal 1024 ** 3, 1.gigabytes
41     assert_equal 1024 ** 3, 1.gigabyte
42   end
43 end