Skip to content

Commit a78900b

Browse files
authored
Allow running test suite without libuhdr (#428)
1 parent 3062214 commit a78900b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

spec/image_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@
727727
end
728728

729729
# added in 8.18
730-
if Vips.respond_to? :vips_image_get_gainmap
730+
if has_uhdr?
731731
it "can modify gainmaps" do
732732
# test the example code in image.rb doc comment for get_gainmap
733733
def modify_gainmap image

spec/spec_helper.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ def timg(name)
2323
end
2424

2525
def has_jpeg?
26-
Vips.type_find("VipsOperation", "jpegload") != nil
26+
Vips.type_find("VipsOperation", "jpegload") != 0
2727
end
2828

2929
def has_svg?
30-
Vips.type_find("VipsOperation", "svgload") != nil
30+
Vips.type_find("VipsOperation", "svgload") != 0
31+
end
32+
33+
def has_uhdr?
34+
Vips.type_find("VipsOperation", "uhdrload") != 0
3135
end
3236

3337
RSpec.configure do |config|

0 commit comments

Comments
 (0)