diff options
| author | lstrzebinczyk <[email protected]> | 2017-05-27 20:56:35 +0200 |
|---|---|---|
| committer | Tom Black <[email protected]> | 2017-06-03 20:30:43 -0400 |
| commit | 3a694ffebcff71305d79c6e8c15246d671ce3888 (patch) | |
| tree | 0c5ea151fa8ad76aa2e4feb447d6fe9efef1c409 /test/image_spec.rb | |
| parent | 65187cd5126227778146ec33c2857a391fbab620 (diff) | |
| download | ruby2d-3a694ffebcff71305d79c6e8c15246d671ce3888.tar.gz ruby2d-3a694ffebcff71305d79c6e8c15246d671ce3888.zip | |
Use named arguments (#65)
Diffstat (limited to 'test/image_spec.rb')
| -rw-r--r-- | test/image_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/image_spec.rb b/test/image_spec.rb index 33dee35..5f57c26 100644 --- a/test/image_spec.rb +++ b/test/image_spec.rb @@ -3,19 +3,19 @@ require 'ruby2d' RSpec.describe Ruby2D::Image do describe '#new' do it "raises exception if image file doesn't exist" do - expect { Image.new(0, 0, 'bad_image.png') }.to raise_error(Ruby2D::Error) + expect { Image.new(path: 'bad_image.png') }.to raise_error(Ruby2D::Error) end end # Image has 100 width and 100 height describe '#contains?' do it "returns true if point is inside image" do - image = Image.new(0, 0, "test/media/image.bmp") + image = Image.new(path: "test/media/image.bmp") expect(image.contains?(50, 50)).to be true end it "returns true if point is not inside image" do - image = Image.new(0, 0, "test/media/image.bmp") + image = Image.new(path: "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 |
