From 0a35b125f40e003398c03833ef72ce263dbbc9cf Mon Sep 17 00:00:00 2001 From: HoneyryderChuck Date: Mon, 23 Jan 2023 12:13:31 +0000 Subject: [PATCH] linting previous test --- regression_tests/bug_0_22_2_test.rb | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/regression_tests/bug_0_22_2_test.rb b/regression_tests/bug_0_22_2_test.rb index 3fbcdb70..6f3f8f34 100644 --- a/regression_tests/bug_0_22_2_test.rb +++ b/regression_tests/bug_0_22_2_test.rb @@ -9,8 +9,8 @@ class Bug_0_22_2_Test < Minitest::Test Plugin = Module.new do @connections = [] - def self.connections - @connections + class << self + attr_reader :connections end self::ConnectionMethods = Module.new do @@ -22,11 +22,12 @@ def initialize(*) end def test_happy_eyeballs_v2_use_correct_family - connections = [] + ipv4_host = "badipv6.test.ipv6friday.org" + ipv6_host = "badipv4.test.ipv6friday.org" HTTPX.plugin(Plugin).wrap do |http| - response_ipv4 = http.get("http://#{ipv4_host}") - response_ipv6 = http.get("http://#{ipv6_host}") + _response_ipv4 = http.get("http://#{ipv4_host}") + _response_ipv6 = http.get("http://#{ipv6_host}") end assert Plugin.connections.size == 2 connection_ipv4 = Plugin.connections.find { |conn| conn.origin.to_s == "http://#{ipv4_host}" } @@ -35,14 +36,4 @@ def test_happy_eyeballs_v2_use_correct_family assert connection_ipv4.family == Socket::AF_INET assert connection_ipv6.family == Socket::AF_INET6 end - - private - - def ipv4_host - "badipv6.test.ipv6friday.org" - end - - def ipv6_host - "badipv4.test.ipv6friday.org" - end -end \ No newline at end of file +end