Permalink
Browse files

jruby 1.9 mode still complaining about string encoding, try forcing i…

…t immediately
  • Loading branch information...
1 parent 542cac4 commit b1d0c38fe8dd6d64b58ce417ac20e76900807781 @zawaideh zawaideh committed Feb 12, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −2 test/test_linkparse.rb
View
7 test/test_linkparse.rb
@@ -100,8 +100,11 @@ def test_linkparse
assert_equal(numtests, testnum, "Number of tests")
# test handling of invalid UTF-8 byte sequences
- html = "<html><body>hello joel\255</body></html>"
- html = html.force_encoding('UTF-8') if html.respond_to? :force_encoding
+ if "".respond_to? :force_encoding
+ html = "<html><body>hello joel\255</body></html>".force_encoding('UTF-8')
+ else
+ html = "<html><body>hello joel\255</body></html>"
+ end
assert_nothing_raised do
OpenID::parse_link_attrs(html)
end

0 comments on commit b1d0c38

Please sign in to comment.