Skip to content

Commit

Permalink
Merge pull request #562 from sparklemotion/flavorjones/get-jruby-green
Browse files Browse the repository at this point in the history
Make JRuby green
  • Loading branch information
flavorjones authored Jan 23, 2021
2 parents 25157bd + 8466789 commit 687c538
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/mechanize/test_case/gzip_servlet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ def do_GET(req, res)

if name = req.query['file'] then
open "#{TEST_DIR}/htdocs/#{name}" do |io|
string = ""
string = String.new
zipped = StringIO.new string, 'w'
Zlib::GzipWriter.wrap zipped do |gz|
gz.write io.read
end
res.body = string
end
else
res.body = ''
res.body = String.new
end

res['Content-Encoding'] = req['X-ResponseContentEncoding'] || 'gzip'
Expand Down
4 changes: 1 addition & 3 deletions test/test_mechanize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,7 @@ def test_get_scheme_unsupported
end

def test_get_space
page = nil

page = @mech.get("http://localhost/tc_bad_links.html ")
@mech.get("http://localhost/tc_bad_links.html ")

assert_match(/tc_bad_links.html$/, @mech.history.last.uri.to_s)

Expand Down
1 change: 1 addition & 0 deletions test/test_mechanize_form_keygen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def test_key
end

def test_spki_signature
skip("JRuby PKI doesn't handle this for reasons I've been unable to understand") if RUBY_ENGINE=~/jruby/
spki = OpenSSL::Netscape::SPKI.new @keygen.value
assert_equal @keygen.challenge, spki.challenge
assert_equal @keygen.key.public_key.to_pem, spki.public_key.to_pem
Expand Down
2 changes: 1 addition & 1 deletion test/test_mechanize_http_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ def test_response_content_encoding_gzip_corrupt
body_io = StringIO.new \
"\037\213\b\0002\002\225M\000\003+H,*\001"

return if jruby_zlib?
skip if jruby_zlib?

e = assert_raises Mechanize::Error do
@agent.response_content_encoding @res, body_io
Expand Down

0 comments on commit 687c538

Please sign in to comment.