Compare commits

...

4 Commits

Author SHA1 Message Date
HoneyryderChuck
ab3bc3ea18 Merge branch 'fix-23-image' into 'master'
fix CI ruby 2.3 build which could not download iptables package

See merge request os85/httpx!248
2023-04-25 21:45:29 +00:00
HoneyryderChuck
62a241b22e fix CI ruby 2.3 build which could not download iptables package 2023-04-25 22:34:05 +01:00
HoneyryderChuck
8db1557827 Merge branch 'fix-webmock-adapter-enable-disable-issue' into 'master'
Fix WebMock adapter so that it gets disabled when WebMock gets disabled

See merge request os85/httpx!247
2023-04-25 07:25:08 +00:00
Kevin Elliott
5108a6247f Fix WebMock adapter so that it gets disabled when WebMock gets disabled 2023-04-25 07:25:07 +00:00
3 changed files with 14 additions and 2 deletions

View File

@ -204,6 +204,16 @@ class WebmockTest < Minitest::Test
WebMock.disable_net_connect! WebMock.disable_net_connect!
end end
def test_webmock_disable_after_enable
WebMock.disable!
# WebMock is disabled so this will make a real http request
http_request(:get, "http://#{httpbin}")
# WebMock is disabled so it should not have registered the request
assert_not_requested(:get, "http://#{httpbin}")
end
private private
def assert_raise_with_message(e, message, &block) def assert_raise_with_message(e, message, &block)

View File

@ -122,7 +122,7 @@ module WebMock
class << self class << self
def enable! def enable!
@original_session = HTTPX::Session @original_session ||= HTTPX::Session
webmock_session = HTTPX.plugin(Plugin) webmock_session = HTTPX.plugin(Plugin)

View File

@ -16,8 +16,10 @@ if [[ "$RUBY_ENGINE" = "truffleruby" ]]; then
elif [[ "$RUBY_PLATFORM" = "java" ]]; then elif [[ "$RUBY_PLATFORM" = "java" ]]; then
apt-get update && apt-get install -y build-essential iptables iproute2 file idn2 git apt-get update && apt-get install -y build-essential iptables iproute2 file idn2 git
elif [[ ${RUBY_VERSION:0:3} = "2.3" ]]; then elif [[ ${RUBY_VERSION:0:3} = "2.3" ]]; then
# installing custom openssl echo "deb http://archive.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list
apt-get update && apt-get install -y iptables iproute2 iptables-nftables-compat libmagic-dev shared-mime-info # openssl=1.0.2l openssl-dev=1.0.2l apt-get update && apt-get install -y iptables iproute2 iptables-nftables-compat libmagic-dev shared-mime-info # openssl=1.0.2l openssl-dev=1.0.2l
IPTABLES=iptables
# installing custom openssl
wget http://deb.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2u-1~deb9u1_amd64.deb wget http://deb.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2u-1~deb9u1_amd64.deb
dpkg -i libssl1.0.2_1.0.2u-1~deb9u1_amd64.deb dpkg -i libssl1.0.2_1.0.2u-1~deb9u1_amd64.deb
wget http://deb.debian.org/debian/pool/main/o/openssl1.0/libssl1.0-dev_1.0.2u-1~deb9u1_amd64.deb wget http://deb.debian.org/debian/pool/main/o/openssl1.0/libssl1.0-dev_1.0.2u-1~deb9u1_amd64.deb