Skip to content

Commit

Permalink
test: conditionally skip depending on net-http-persistent < v4
Browse files Browse the repository at this point in the history
Net::HTTP::Persistent removed `#retry_change_requests` in v4.0.0 and
later, so these tests fail if we've pulled in a more recent version
than that.

Related to drbrain/net-http-persistent#100
  • Loading branch information
flavorjones committed Jan 23, 2021
1 parent b7c6af7 commit 4fc17ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/test_mechanize.rb
Expand Up @@ -1056,6 +1056,11 @@ def test_referer
end

def test_retry_change_requests_equals
unless Gem::Requirement.new("< 4.0.0").satisfied_by?(Gem::Version.new(Net::HTTP::Persistent::VERSION))
# see https://github.com/drbrain/net-http-persistent/pull/100
skip("net-http-persistent 4.0.0 and later does not support retry_change_requests")
end

refute @mech.retry_change_requests

@mech.retry_change_requests = true
Expand Down
5 changes: 5 additions & 0 deletions test/test_mechanize_http_agent.rb
Expand Up @@ -1590,6 +1590,11 @@ def test_response_redirect_permanent_temporary
end

def test_retry_change_request_equals
unless Gem::Requirement.new("< 4.0.0").satisfied_by?(Gem::Version.new(Net::HTTP::Persistent::VERSION))
# see https://github.com/drbrain/net-http-persistent/pull/100
skip("net-http-persistent 4.0.0 and later does not support retry_change_requests")
end

refute @agent.http.retry_change_requests

@agent.retry_change_requests = true
Expand Down

0 comments on commit 4fc17ae

Please sign in to comment.