Skip to content
This repository was archived by the owner on Dec 7, 2017. It is now read-only.

Commit f680013

Browse files
committed
disable webp tests for old libvips
1 parent 3ae7d8e commit f680013

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

spec/vips/webp_writer_spec.rb

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
end
99

1010
it "should write to a webp file" do
11-
@writer.write(@path)
11+
if Spec::Helpers.match_vips_version(">= 7.42")
12+
@writer.write(@path)
1213

13-
# no webp reader
14-
#im = VIPS::Image.webp @path
15-
#im.x_size.should == @image.x_size
16-
#im.y_size.should == @image.y_size
14+
# no webp reader
15+
#im = VIPS::Image.webp @path
16+
#im.x_size.should == @image.x_size
17+
#im.y_size.should == @image.y_size
18+
end
1719
end
1820

1921
it "should set a default quality of 75" do
@@ -32,15 +34,17 @@
3234
end
3335

3436
it "should write smaller images with lower quality settings" do
35-
@writer.quality = 10
36-
@writer.write(@path)
37-
size1 = File.size @path
38-
39-
@writer.quality = 90
40-
@writer.write(@path)
41-
size2 = File.size @path
42-
43-
size1.should < size2 / 2
37+
if Spec::Helpers.match_vips_version(">= 7.42")
38+
@writer.quality = 10
39+
@writer.write(@path)
40+
size1 = File.size @path
41+
42+
@writer.quality = 90
43+
@writer.write(@path)
44+
size2 = File.size @path
45+
46+
size1.should < size2 / 2
47+
end
4448
end
4549

4650
it "should create a webp writer from an image" do
@@ -49,8 +53,10 @@
4953
end
5054

5155
it "should accept options on creation from an image" do
52-
writer = @image.webp(nil, :quality => 22)
53-
writer.quality.should == 22
56+
if Spec::Helpers.match_vips_version(">= 7.42")
57+
writer = @image.webp(nil, :quality => 22)
58+
writer.quality.should == 22
59+
end
5460
end
5561

5662
it "should allow access to header fields" do

0 commit comments

Comments
 (0)