Commit 7792407e by Jon Yurek

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

parents 5751624c 9f3fec1d
...@@ -65,7 +65,8 @@ module Paperclip ...@@ -65,7 +65,8 @@ module Paperclip
def to_s def to_s
s = "" s = ""
s << width.to_i.to_s if width > 0 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 s
end end
......
...@@ -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