Skip to content

Instantly share code, notes, and snippets.

@edipofederle
Created January 1, 2011 14:39
Show Gist options
  • Select an option

  • Save edipofederle/761783 to your computer and use it in GitHub Desktop.

Select an option

Save edipofederle/761783 to your computer and use it in GitHub Desktop.
require "test/unit"
require "fatorial.rb"
class TestLibraryFileName < Test::Unit::TestCase
def test_simples_cases
assert_equal(120, fatorial(5))
assert_equal(6, fatorial(3))
end
def test_negative_numbers
assert_raise(ArgumentError) {fatorial(-1)}
end
def test_invalid_argument_type
assert_raise(TypeError) {fatorial("a")}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment