File: test_sugar.rb

package info (click to toggle)
god 0.7.18-3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 908 kB
  • sloc: ruby: 5,516; ansic: 241; makefile: 129; sh: 27
file content (42 lines) | stat: -rw-r--r-- 792 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require File.dirname(__FILE__) + '/helper'

class TestSugar < Test::Unit::TestCase
  def test_seconds
    assert_equal 1, 1.seconds
    assert_equal 1, 1.second
  end
  
  def test_minutes
    assert_equal 60, 1.minutes
    assert_equal 60, 1.minute
  end
  
  def test_hours
    assert_equal 3600, 1.hours
    assert_equal 3600, 1.hour
  end
  
  def test_days
    assert_equal 86400, 1.days
    assert_equal 86400, 1.day
  end
  
  def test_kilobytes
    assert_equal 1, 1.kilobytes
    assert_equal 1, 1.kilobyte
  end
  
  def test_megabytes
    assert_equal 1024, 1.megabytes
    assert_equal 1024, 1.megabyte
  end
  
  def test_gigabytes
    assert_equal 1024 ** 2, 1.gigabytes
    assert_equal 1024 ** 2, 1.gigabyte
  end
  
  def test_percent
    assert_equal 1, 1.percent
  end
end