Skip to content

Commit

Permalink
add a test case
Browse files Browse the repository at this point in the history
  • Loading branch information
lab-kw committed Aug 9, 2022
1 parent 8a8e4a9 commit 31cd87f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Binary file added spec/fixtures/large_webp.webp
Binary file not shown.
7 changes: 7 additions & 0 deletions spec/lib/mini_magick/image_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,13 @@ def create(path = image_path)
subject.size("20x20")
end

describe "#size" do
it "returns the correct value even if the log contains unit prefixes" do
subject = described_class.new(image_path(:large_webp))
expect(subject.size).to be_a(Integer)
end
end

describe "#exif" do
it "returns a hash of EXIF data" do
subject = described_class.new(image_path(:exif))
Expand Down
1 change: 1 addition & 0 deletions spec/support/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def image_path(type = :default)
when :rgb then "rgb.png"
when :rgb_tmp then "rgb_tmp.png"
when :non_ascii_filename then "スクリーンショット 2019-07-13 1.32.01.png"
when :large_webp then "large_webp.webp"
else
fail "image #{type.inspect} doesn't exist"
end
Expand Down

0 comments on commit 31cd87f

Please sign in to comment.