Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/dasil003/attachment_fu
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Sep 20, 2008
2 parents 287472f + 9056517 commit 88af790
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/geometry.rb
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions test/geometry_test.rb
Expand Up @@ -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],
Expand Down

0 comments on commit 88af790

Please sign in to comment.