summaryrefslogtreecommitdiffhomepage
path: root/test/image_spec.rb
diff options
context:
space:
mode:
authorTom Black <[email protected]>2018-10-05 22:44:13 -0700
committerTom Black <[email protected]>2018-10-08 17:34:17 -0700
commit4a4df9831003e0c9f51278b968a78d1900b9a3d9 (patch)
tree9c3ea4774243a48e07ee75f18da77b2ba1c1bf6f /test/image_spec.rb
parent13821e171daa52e2b9c4d35320eee0492b727bb7 (diff)
downloadruby2d-4a4df9831003e0c9f51278b968a78d1900b9a3d9.tar.gz
ruby2d-4a4df9831003e0c9f51278b968a78d1900b9a3d9.zip
Reorganize Image, Sprite, and Text args
Start with the required argument first as positional, followed by optional ones as keyword arguments Co-Authored-By: Andrew Havens <[email protected]>
Diffstat (limited to 'test/image_spec.rb')
-rw-r--r--test/image_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/image_spec.rb b/test/image_spec.rb
index f175a01..e2ef37e 100644
--- a/test/image_spec.rb
+++ b/test/image_spec.rb
@@ -4,18 +4,18 @@ RSpec.describe Ruby2D::Image do
describe "#new" do
it "raises exception if image file doesn't exist" do
- expect { Image.new(path: "bad_image.png") }.to raise_error(Ruby2D::Error)
+ expect { Image.new("bad_image.png") }.to raise_error(Ruby2D::Error)
end
end
describe "#contains?" do
it "returns true if point is inside the image" do
- image = Image.new(path: "test/media/image.bmp")
+ image = Image.new("test/media/image.bmp")
expect(image.contains?(50, 50)).to be true
end
it "returns true if point is outside the image" do
- image = Image.new(path: "test/media/image.bmp")
+ image = Image.new("test/media/image.bmp")
expect(image.contains?(-50, 50)).to be false
expect(image.contains?(50, -50)).to be false
expect(image.contains?(50, 150)).to be false