This repository has been archived by the owner on Feb 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Oh look! Unit tests found a bug! I was calling image.last.width inste…
…ad of image.first.height for the height of the diff :(
- Loading branch information
1 parent
6eb6b32
commit 0e911a5
Showing
2 changed files
with
46 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require_relative '../spec_helper' | ||
|
||
describe Compatriot::ImageDiffer do | ||
describe "self#diff" do | ||
it "calls chunky_png on each image path" do | ||
file_one = stub | ||
file_two = stub | ||
|
||
ChunkyPNG::Image.expects(:from_file).with(file_one) | ||
ChunkyPNG::Image.expects(:from_file).with(file_two) | ||
Compatriot::ImageDiffer.stubs(:color_difference) | ||
|
||
Compatriot::ImageDiffer.diff([file_one, file_two]) | ||
end | ||
|
||
it "returns the filename of the diff" do | ||
end | ||
|
||
it "uses the strategy passed in" do | ||
end | ||
end | ||
|
||
describe "self#color_difference" do | ||
it "starts a new white image with the same dimensions" do | ||
ChunkyPNG::Image.expects(:new).with(1, 2, ChunkyPNG::Image::WHITE) | ||
|
||
image1 = stub(:width => 1, :height => 2) | ||
|
||
Compatriot::ImageDiffer.color_difference([image1], stub) | ||
end | ||
end | ||
end |