Permalink
Browse files

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

…ven when only one dimension is present).
  • Loading branch information...
1 parent db9cbbc commit 9f3fec1deddd0678d6ecbf824cc1b840db43b5fe Steve committed Nov 14, 2008
Showing with 7 additions and 5 deletions.
  1. +7 −5 test/geometry_test.rb
View
@@ -44,11 +44,6 @@ class GeometryTest < Test::Unit::TestCase
assert_equal 0, @geo.height
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
assert @geo = Paperclip::Geometry.parse("123x456")
assert_nil @geo.modifier
@@ -60,6 +55,13 @@ class GeometryTest < Test::Unit::TestCase
assert_equal mod, @geo.modifier
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
assert @src = Paperclip::Geometry.parse("123x456")

0 comments on commit 9f3fec1

Please sign in to comment.