From 3a694ffebcff71305d79c6e8c15246d671ce3888 Mon Sep 17 00:00:00 2001 From: lstrzebinczyk Date: Sat, 27 May 2017 20:56:35 +0200 Subject: Use named arguments (#65) --- test/rectangle_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/rectangle_spec.rb') diff --git a/test/rectangle_spec.rb b/test/rectangle_spec.rb index 493f3d1..940b6cc 100644 --- a/test/rectangle_spec.rb +++ b/test/rectangle_spec.rb @@ -3,16 +3,16 @@ require 'ruby2d' RSpec.describe Ruby2D::Rectangle do describe '#contains?' do it "returns true if point is inside rectangle" do - rectangle = Rectangle.new(0, 0, 50, 50) + rectangle = Rectangle.new(x: 0, y: 0, width: 50, height: 50) expect(rectangle.contains?(25, 25)).to be true end it "returns true if point is not inside rectangle" do - rectangle = Rectangle.new(0, 0, 50, 50) - expect(rectangle.contains?(-25, 25)).to be false - expect(rectangle.contains?(25, -25)).to be false - expect(rectangle.contains?(25, 50)).to be false - expect(rectangle.contains?(50, 25)).to be false + rectangle = Rectangle.new(x: 0, y: 0, width: 50, height: 50) + expect(rectangle.contains?(-25, 25)).to be false + expect(rectangle.contains?( 25, -25)).to be false + expect(rectangle.contains?( 25, 50)).to be false + expect(rectangle.contains?( 50, 25)).to be false end end end -- cgit v1.2.3