Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git://github.com/dasil003/attachment_fu

  • Loading branch information...
commit 88af79006b22b24efaab69c2ada0b8da36f9618d 2 parents 287472f + 9056517
@technoweenie technoweenie authored
Showing with 8 additions and 1 deletion.
  1. +1 −1  lib/geometry.rb
  2. +7 −0 test/geometry_test.rb
View
2  lib/geometry.rb
@@ -25,7 +25,7 @@ def initialize(width=nil, height=nil, x=nil, y=nil, flag=nil)
end
# Construct an object from a geometry string
- RE = /\A(\d*)(?:x(\d+))?([-+]\d+)?([-+]\d+)?([%!<>@]?)\Z/
+ RE = /\A(\d*)(?:x(\d+)?)?([-+]\d+)?([-+]\d+)?([%!<>@]?)\Z/
def self.from_s(str)
raise(ArgumentError, "no geometry string specified") unless str
View
7 test/geometry_test.rb
@@ -23,6 +23,13 @@ def test_should_resize_no_height
"100" => [100, 128]
end
+ def test_should_resize_no_height_with_x
+ assert_geometry 50, 64,
+ "50x" => [50, 64],
+ "60x" => [60, 77],
+ "100x" => [100, 128]
+ end
+
def test_should_resize_with_percent
assert_geometry 50, 64,
"50x50%" => [25, 32],
Please sign in to comment.
Something went wrong with that request. Please try again.