Permalink
Browse files

More fine-grained tests for thumbnail.

  • Loading branch information...
1 parent 169dee4 commit 05909057b4e6d75c780f517e1756badc89a4faf1 @xuanxu xuanxu committed May 18, 2012
Showing with 9 additions and 12 deletions.
  1. +9 −12 test/thumbnail_test.rb
View
21 test/thumbnail_test.rb
@@ -113,10 +113,9 @@ class ThumbnailTest < Test::Unit::TestCase
end
should "send the right command to convert when sent #make" do
- Paperclip.expects(:run).with do |*arg|
- arg[0] == 'convert' &&
- arg[1] == ':source -resize "x50" -crop "100x50+114+0" +repage :dest' &&
- arg[2][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
+ @thumb.expects(:convert).with do |*arg|
+ arg[0] == ':source -resize "x50" -crop "100x50+114+0" +repage :dest' &&
+ arg[1][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
end
@thumb.make
end
@@ -139,10 +138,9 @@ class ThumbnailTest < Test::Unit::TestCase
end
should "send the right command to convert when sent #make" do
- Paperclip.expects(:run).with do |*arg|
- arg[0] == 'convert' &&
- arg[1] == '-strip :source -resize "x50" -crop "100x50+114+0" +repage :dest' &&
- arg[2][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
+ @thumb.expects(:convert).with do |*arg|
+ arg[0] == '-strip :source -resize "x50" -crop "100x50+114+0" +repage :dest' &&
+ arg[1][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
end
@thumb.make
end
@@ -181,10 +179,9 @@ class ThumbnailTest < Test::Unit::TestCase
end
should "send the right command to convert when sent #make" do
- Paperclip.expects(:run).with do |*arg|
- arg[0] == 'convert' &&
- arg[1] == ':source -resize "x50" -crop "100x50+114+0" +repage -strip -depth 8 :dest' &&
- arg[2][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
+ @thumb.expects(:convert).with do |*arg|
+ arg[0] == ':source -resize "x50" -crop "100x50+114+0" +repage -strip -depth 8 :dest' &&
+ arg[1][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
end
@thumb.make
end

0 comments on commit 0590905

Please sign in to comment.