Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit b1d0c38

Browse files
author
Zaid Zawaideh
committed
jruby 1.9 mode still complaining about string encoding, try forcing it immediately
1 parent 542cac4 commit b1d0c38

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

test/test_linkparse.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ def test_linkparse
100100
assert_equal(numtests, testnum, "Number of tests")
101101

102102
# test handling of invalid UTF-8 byte sequences
103-
html = "<html><body>hello joel\255</body></html>"
104-
html = html.force_encoding('UTF-8') if html.respond_to? :force_encoding
103+
if "".respond_to? :force_encoding
104+
html = "<html><body>hello joel\255</body></html>".force_encoding('UTF-8')
105+
else
106+
html = "<html><body>hello joel\255</body></html>"
107+
end
105108
assert_nothing_raised do
106109
OpenID::parse_link_attrs(html)
107110
end

0 commit comments

Comments
 (0)