Permalink
Browse files

Avoid invalid URIs on Ruby 1.8.7.

  • Loading branch information...
drbrain committed Nov 9, 2011
1 parent 3471f76 commit 40f7f2cd44725a3c7f5867e3d6d84d0ca3a52036
Showing with 6 additions and 2 deletions.
  1. +6 −2 test/test_mechanize_parser.rb
@@ -159,9 +159,13 @@ def test_extract_filename_special_character
invisible = "\t\n\v\f\r"
invisible.chars.each do |char|
- @parser.uri = URI "http://example/#{char}"
+ begin
+ @parser.uri = URI "http://example/#{char}"
- assert_equal 'index.html', @parser.extract_filename, char.inspect
+ assert_equal 'index.html', @parser.extract_filename, char.inspect
+ rescue URI::InvalidURIError
+ # ignore
+ end
end
escaped = "<>\"\\|"

0 comments on commit 40f7f2c

Please sign in to comment.