Commit 7792407e by Jon Yurek

Merge branch 'master' of git://github.com/laserlemon/paperclip

parents 5751624c 9f3fec1d
......@@ -65,7 +65,8 @@ module Paperclip
def to_s
s = ""
s << width.to_i.to_s if width > 0
s << "x#{height.to_i}#{modifier}" if height > 0
s << "x#{height.to_i}" if height > 0
s << modifier.to_s
s
end
......
......@@ -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
......@@ -61,6 +56,13 @@ class GeometryTest < Test::Unit::TestCase
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")
assert @dst = 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