Permalink
Browse files

ensure Mechanize::Page::Image#uri returns a URI instance

closes #297
  • Loading branch information...
1 parent 432a4e7 commit 031b9e55e5065026335c0fb6d87cf6eee2a39bcb @leejarvis leejarvis committed Mar 1, 2013
Showing with 4 additions and 3 deletions.
  1. +2 −2 lib/mechanize/page/image.rb
  2. +2 −1 test/test_mechanize_page_image.rb
@@ -162,10 +162,10 @@ def url
if page.bases[0] then
page.bases[0].href + src
else
- page.uri + src
+ URI page.uri + src
end
else
- src
+ URI src
end
end
@@ -52,7 +52,8 @@ def test_caption
end
def test_url
- assert_equal "http://example/a.jpg", img('src' => @src).url
+ assert_equal ".jpg", img('src' => @src).extname
+ assert_equal "http://example/a.jpg", img('src' => @src).url.to_s
end
def test_url_base

0 comments on commit 031b9e5

Please sign in to comment.