0a9428093c
git-subtree-dir: RubyFun git-subtree-mainline:a04a502787
git-subtree-split:b01c682613
26 lines
810 B
Ruby
26 lines
810 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 AboutTriangleProject < EdgeCase::Koan
|
|
def test_equilateral_triangles_have_equal_sides
|
|
assert_equal :equilateral, triangle(2, 2, 2)
|
|
assert_equal :equilateral, triangle(10, 10, 10)
|
|
end
|
|
|
|
def test_isosceles_triangles_have_exactly_two_sides_equal
|
|
assert_equal :isosceles, triangle(3, 4, 4)
|
|
assert_equal :isosceles, triangle(4, 3, 4)
|
|
assert_equal :isosceles, triangle(4, 4, 3)
|
|
assert_equal :isosceles, triangle(10, 10, 2)
|
|
end
|
|
|
|
def test_scalene_triangles_have_no_equal_sides
|
|
assert_equal :scalene, triangle(3, 4, 5)
|
|
assert_equal :scalene, triangle(10, 11, 12)
|
|
assert_equal :scalene, triangle(5, 4, 2)
|
|
end
|
|
end
|
|
|