Commit 9f3fec1d by Steve

Added a test to ensure the given modifier is passed to ImageMagick (even when…

Added a test to ensure the given modifier is passed to ImageMagick (even when only one dimension is present).
parent db9cbbc5
...@@ -44,11 +44,6 @@ class GeometryTest < Test::Unit::TestCase ...@@ -44,11 +44,6 @@ class GeometryTest < Test::Unit::TestCase
assert_equal 0, @geo.height assert_equal 0, @geo.height
end end
should "ensure the modifier is nil if only one dimension present" do
assert @geo = Paperclip::Geometry.parse("123x")
assert_nil @geo.modifier
end
should "ensure the modifier is nil if not present" do should "ensure the modifier is nil if not present" do
assert @geo = Paperclip::Geometry.parse("123x456") assert @geo = Paperclip::Geometry.parse("123x456")
assert_nil @geo.modifier assert_nil @geo.modifier
...@@ -60,6 +55,13 @@ class GeometryTest < Test::Unit::TestCase ...@@ -60,6 +55,13 @@ class GeometryTest < Test::Unit::TestCase
assert_equal mod, @geo.modifier assert_equal mod, @geo.modifier
end end
end end
['>', '<', '#', '@', '%', '^', '!'].each do |mod|
should "ensure the modifier #{mod} gets passed to ImageMagic" do
assert @geo = Paperclip::Geometry.parse("123x#{mod}")
assert_equal mod, @geo.to_s.last
end
end
should "make sure the modifier gets passed during transformation_to" do should "make sure the modifier gets passed during transformation_to" do
assert @src = Paperclip::Geometry.parse("123x456") assert @src = Paperclip::Geometry.parse("123x456")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment