Sha256: b2642c416f4267d639f645654c2cb29c28395dbcd14c82e6469e3c80c71e4127
Contents?: true
Size: 1.34 KB
Versions: 1
Compression:
Stored size: 1.34 KB
Contents
require 'helper' class TestDupeMagick < Test::Unit::TestCase should "compare two identical images and return a euclidian distance of 0" do comparison = DupeMagick.new path = File.expand_path(File.dirname(__FILE__)) assert_equal 0, comparison.compare_images( path + "/" + "images/first_wife.png", path + "/" + "images/second_wife.jpg", { :geometry => '8x8!' } ) end should "compare two possibly similar images and return a euclidian distance of 104" do comparison = DupeMagick.new path = File.expand_path(File.dirname(__FILE__)) assert_equal 104, comparison.compare_images( path + "/" + "images/first_wife.png", path + "/" + "images/bright_wife.png", { :geometry => '8x8!' } ) end should "compare two different images and return a euclidian distance of 531" do comparison = DupeMagick.new path = File.expand_path(File.dirname(__FILE__)) assert_equal 531, comparison.compare_images( path + "/" + "images/first_wife.png", path + "/" + "images/different.jpg", { :geometry => '8x8!' } ) end should "parse a file path" do comparison = DupeMagick.new path = File.expand_path(File.dirname(__FILE__)) comparison.find_duplicates(path + "/" + "images/first_wife.png", path + "/" + "images/*") end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dupe-magick-1.0.1 | test/test_dupe-magick.rb |