summaryrefslogtreecommitdiffhomepage
path: root/test/line_spec.rb
diff options
context:
space:
mode:
authorlstrzebinczyk <[email protected]>2017-05-27 20:56:35 +0200
committerTom Black <[email protected]>2017-06-03 20:30:43 -0400
commit3a694ffebcff71305d79c6e8c15246d671ce3888 (patch)
tree0c5ea151fa8ad76aa2e4feb447d6fe9efef1c409 /test/line_spec.rb
parent65187cd5126227778146ec33c2857a391fbab620 (diff)
downloadruby2d-3a694ffebcff71305d79c6e8c15246d671ce3888.tar.gz
ruby2d-3a694ffebcff71305d79c6e8c15246d671ce3888.zip
Use named arguments (#65)
Diffstat (limited to 'test/line_spec.rb')
-rw-r--r--test/line_spec.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/test/line_spec.rb b/test/line_spec.rb
index 04445d1..669d440 100644
--- a/test/line_spec.rb
+++ b/test/line_spec.rb
@@ -3,19 +3,11 @@ require 'ruby2d'
RSpec.describe Ruby2D::Triangle do
describe '#contains?' do
it "returns true if point is inside line" do
- line = Line.new(
- 0, 0,
- 100, 100
- )
+ 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
- line = Line.new(
- 0, 0,
- 100, 100
- )
-
+ 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