Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
More fine-grained tests for thumbnail.
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanxu committed May 18, 2012
1 parent 169dee4 commit 0590905
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions test/thumbnail_test.rb
Expand Up @@ -113,10 +113,9 @@ class ThumbnailTest < Test::Unit::TestCase
end end


should "send the right command to convert when sent #make" do should "send the right command to convert when sent #make" do
Paperclip.expects(:run).with do |*arg| @thumb.expects(:convert).with do |*arg|
arg[0] == 'convert' && arg[0] == ':source -resize "x50" -crop "100x50+114+0" +repage :dest' &&
arg[1] == ':source -resize "x50" -crop "100x50+114+0" +repage :dest' && arg[1][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
arg[2][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
end end
@thumb.make @thumb.make
end end
Expand All @@ -139,10 +138,9 @@ class ThumbnailTest < Test::Unit::TestCase
end end


should "send the right command to convert when sent #make" do should "send the right command to convert when sent #make" do
Paperclip.expects(:run).with do |*arg| @thumb.expects(:convert).with do |*arg|
arg[0] == 'convert' && arg[0] == '-strip :source -resize "x50" -crop "100x50+114+0" +repage :dest' &&
arg[1] == '-strip :source -resize "x50" -crop "100x50+114+0" +repage :dest' && arg[1][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
arg[2][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
end end
@thumb.make @thumb.make
end end
Expand Down Expand Up @@ -181,10 +179,9 @@ class ThumbnailTest < Test::Unit::TestCase
end end


should "send the right command to convert when sent #make" do should "send the right command to convert when sent #make" do
Paperclip.expects(:run).with do |*arg| @thumb.expects(:convert).with do |*arg|
arg[0] == 'convert' && arg[0] == ':source -resize "x50" -crop "100x50+114+0" +repage -strip -depth 8 :dest' &&
arg[1] == ':source -resize "x50" -crop "100x50+114+0" +repage -strip -depth 8 :dest' && arg[1][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
arg[2][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
end end
@thumb.make @thumb.make
end end
Expand Down

0 comments on commit 0590905

Please sign in to comment.