Skip to content

Commit

Permalink
linting previous test
Browse files Browse the repository at this point in the history
  • Loading branch information
HoneyryderChuck committed Jan 25, 2023
1 parent a6cfaf4 commit 0a35b12
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions regression_tests/bug_0_22_2_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}" }
Expand All @@ -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
end

0 comments on commit 0a35b12

Please sign in to comment.