Sha256: 4355d19dfd8f7b602ae24076d943773176c57263097e301cff72710c68d1712b

Contents?: true

Size: 753 Bytes

Versions: 1

Compression:

Stored size: 753 Bytes

Contents

require 'helper'

class FixnumTest < MiniTest::Unit::TestCase
  def test_converting_a_number_to_a_roman_numeral
    assert_equal Roman(124), 124.to_roman
  end

  def test_conversion_of_too_big_numbers_raises_exception
    e = assert_raises RangeError do
      19214.to_roman
    end
    assert_match /integer is too big to convert into Roman/, e.message
  end

  def test_conversion_of_zero_raises_exception
    e = assert_raises RangeError do
      0.to_roman
    end
    assert_match /integer is too small to convert into Roman/, e.message
  end

  def test_conversion_of_negative_numbers_raises_exception
    e = assert_raises RangeError do
      0.to_roman
    end
    assert_match /integer is too small to convert into Roman/, e.message
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
romaniac-0.0.1 test/ext/fixnum_test.rb