Evidently, a lot of changes / pull requests were made to the koans directory and not to the src directory. Perhaps we should remove the koans directory entirely from the repo.
18 lines
683 B
Ruby
18 lines
683 B
Ruby
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
|
|
|
# You need to write the triangle method in the file 'triangle.rb'
|
|
require 'triangle.rb'
|
|
|
|
class AboutTriangleProject2 < 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(1, 1, 3) end
|
|
assert_raise(TriangleError) do triangle(2, 4, 2) end
|
|
# HINT: for tips, see http://stackoverflow.com/questions/3834203/ruby-koan-151-raising-exceptions
|
|
end
|
|
end
|
|
|