linkingpaths / alea

Bringing random feelings to the Kernel since 2008

This URL has Read+Write access

alea / test / test_numeric.rb
100644 15 lines (12 sloc) 0.329 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require File.dirname(__FILE__) + '/test_helper.rb'
 
class TestNumeric < Test::Unit::TestCase
 
  def test_regular_percent
    assert_equal 10, 10.percent.of(100)
  end
  def test_rounded_percent
    assert_equal 10, 10.percent.of(99)
  end
  def test_not_rounded_percent
    assert_equal 9.9, 10.percent.of(99, false)
  end
end