diff options
| author | Tom Black <[email protected]> | 2018-09-26 17:21:34 -0700 |
|---|---|---|
| committer | Tom Black <[email protected]> | 2018-09-26 17:21:34 -0700 |
| commit | e2fb9c34d6f56ec833e0451b26a02c304afaf71b (patch) | |
| tree | 35029a30d2d0074ad783926fcd83e6dfe1401a37 /test/image_spec.rb | |
| parent | 6351fe4b374000ba78e3a7795f0f05e63cbdbc29 (diff) | |
| download | ruby2d-e2fb9c34d6f56ec833e0451b26a02c304afaf71b.tar.gz ruby2d-e2fb9c34d6f56ec833e0451b26a02c304afaf71b.zip | |
Documentation and style updates
Diffstat (limited to 'test/image_spec.rb')
| -rw-r--r-- | test/image_spec.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/image_spec.rb b/test/image_spec.rb index 5f57c26..f175a01 100644 --- a/test/image_spec.rb +++ b/test/image_spec.rb @@ -1,20 +1,20 @@ require 'ruby2d' RSpec.describe Ruby2D::Image do - describe '#new' 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(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 + describe "#contains?" do + it "returns true if point is inside the image" do 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 + it "returns true if point is outside the image" do image = Image.new(path: "test/media/image.bmp") expect(image.contains?(-50, 50)).to be false expect(image.contains?(50, -50)).to be false @@ -22,4 +22,5 @@ RSpec.describe Ruby2D::Image do expect(image.contains?(150, 50)).to be false end end + end |
