summaryrefslogtreecommitdiffhomepage
path: root/test/line_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/line_spec.rb')
-rw-r--r--test/line_spec.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/line_spec.rb b/test/line_spec.rb
index 669d440..ac6d005 100644
--- a/test/line_spec.rb
+++ b/test/line_spec.rb
@@ -1,15 +1,18 @@
require 'ruby2d'
-RSpec.describe Ruby2D::Triangle do
- describe '#contains?' do
- it "returns true if point is inside line" do
+RSpec.describe Ruby2D::Line do
+
+ describe "#contains?" do
+ it "returns true if point is inside the line" do
line = Line.new(x1: 0, y1: 0, x2: 100, y2: 100)
expect(line.contains?(25, 25)).to be true
end
- it "returns true if point is inside text" do
+
+ it "returns false if point is outside the line" do
line = Line.new(x1: 0, y1: 0, x2: 100, y2: 100)
expect(line.contains?(0, 10)).to be false
expect(line.contains?(10, 0)).to be false
end
end
+
end