Files
ruby_koans/koans/about_triangle_project_2.rb
unknown fcf5bd860d I renamed the class to AboutTriangleAssignment2 as this was messing with the testing order.
Using the same class name as the other Triangle Assignment was affecting the testing order, causing this assignment to show up before about_exceptions.
2009-03-17 21:50:41 -04:00

16 lines
486 B
Ruby

require 'edgecase'
# You need to write the triangle method in the file 'triangle.rb'
require 'triangle.rb'
class AboutTriangleAssignment2 < EdgeCase::Koan
# The first assignment did not talk about how to handle errors.
# Let's handle that part now.
def test_illegal_triangles_throw_exceptions
assert_raise(TriangleError) do triangle(0, 0, 0) end
assert_raise(TriangleError) do triangle(3, 4, -5) end
assert_raise(TriangleError) do triangle(2, 4, 2) end
end
end