@@ -166,8 +166,8 @@ def sample_region
166166 end
167167 end
168168
169- class VipsUtilTest < ActiveSupport ::TestCase
170- test "VipsUtil .difference_region_by detects difference regions without color threshold" do
169+ class VipsDriverClassMethodsTest < ActiveSupport ::TestCase
170+ test "VipsDriver .difference_region_by detects difference regions without color threshold" do
171171 old_image = Vips ::Image . new_from_file ( "#{ TEST_IMAGES_DIR } /a.png" )
172172 new_image = Vips ::Image . new_from_file ( "#{ TEST_IMAGES_DIR } /b.png" )
173173
@@ -180,7 +180,7 @@ class VipsUtilTest < ActiveSupport::TestCase
180180 assert_equal [ 20.0 , 15.0 , 30.0 , 25.0 ] , [ left , top , right , bottom ]
181181 end
182182
183- test "VipsUtil .difference_region_by respects color_distance threshold" do
183+ test "VipsDriver .difference_region_by respects color_distance threshold" do
184184 old_image = Vips ::Image . new_from_file ( "#{ TEST_IMAGES_DIR } /a.png" )
185185 new_image = Vips ::Image . new_from_file ( "#{ TEST_IMAGES_DIR } /b.png" )
186186
@@ -189,7 +189,7 @@ class VipsUtilTest < ActiveSupport::TestCase
189189 assert_equal [ 26.0 , 18.0 , 27.0 , 19.0 ] , [ left , top , right , bottom ]
190190 end
191191
192- test "VipsUtil .difference_region_by returns correct region coordinates" do
192+ test "VipsDriver .difference_region_by returns correct region coordinates" do
193193 old_image = Vips ::Image . new_from_file ( TEST_IMAGES_DIR . join ( "a.png" ) . to_path )
194194 new_image = Vips ::Image . new_from_file ( TEST_IMAGES_DIR . join ( "b.png" ) . to_path )
195195
@@ -198,18 +198,18 @@ class VipsUtilTest < ActiveSupport::TestCase
198198 assert_equal [ 20.0 , 15.0 , 30.0 , 25.0 ] , [ left , top , right , bottom ]
199199 end
200200
201- test "VipsUtil .difference_area calculates correct area of difference" do
201+ test "VipsDriver .difference_area calculates correct area of difference" do
202202 old_image = Vips ::Image . new_from_file ( "#{ TEST_IMAGES_DIR } /a.png" )
203203 new_image = Vips ::Image . new_from_file ( "#{ TEST_IMAGES_DIR } /d.png" ) . bandjoin ( 255 )
204204
205- assert_equal 8 , VipsDriver :: VipsUtil . difference_area ( old_image , new_image , color_distance : 10 )
205+ assert_equal 8 , VipsDriver . difference_area ( old_image , new_image , color_distance : 10 )
206206 end
207207
208208 private
209209
210210 def difference ( old_image , new_image , color_distance : nil )
211- diff_mask = VipsDriver :: VipsUtil . difference_mask ( new_image , old_image , color_distance )
212- VipsDriver :: VipsUtil . difference_region_by ( diff_mask ) . to_edge_coordinates
211+ diff_mask = VipsDriver . difference_mask ( new_image , old_image , color_distance )
212+ VipsDriver . difference_region_by ( diff_mask ) . to_edge_coordinates
213213 end
214214 end
215215 end
0 commit comments