test/geometry/line.rb in geometry-6 vs test/geometry/line.rb in geometry-6.1
- old
+ new
@@ -104,5 +104,29 @@
it "implement to_s" do
line = Geometry::Line[[0,0], [10,10]]
assert_equal('Line(Point[0, 0], Point[10, 10])', line.to_s)
end
end
+
+describe Geometry::PointSlopeLine do
+ subject { Geometry::PointSlopeLine.new [1,2], 3 }
+
+ it "must have a slope attribute" do
+ subject.slope.must_equal 3
+ end
+end
+
+describe Geometry::SlopeInterceptLine do
+ subject { Geometry::SlopeInterceptLine.new 3, 2 }
+
+ it "must have a slope attribute" do
+ subject.slope.must_equal 3
+ end
+end
+
+describe Geometry::TwoPointLine do
+ subject { Geometry::TwoPointLine.new [1,2], [3,4] }
+
+ it "must have a slope attribute" do
+ subject.slope.must_equal 1
+ end
+end