Skip to content

Fix uninitialized constant Tempfile in dns_spec.rb#92

Merged
Watson1978 merged 1 commit intosocketry:mainfrom
Watson1978:dns_spec
Mar 22, 2026
Merged

Fix uninitialized constant Tempfile in dns_spec.rb#92
Watson1978 merged 1 commit intosocketry:mainfrom
Watson1978:dns_spec

Conversation

@Watson1978
Copy link
Copy Markdown
Collaborator

The tempfile library was implicitly loaded when running the entire test suite, but running spec/dns_spec.rb alone resulted in a NameError. Added require 'tempfile' to ensure the test can be executed independently.

$ rspec spec/dns_spec.rb

DNS
  connects to valid domains
  fires on_resolve_failed for invalid domains
  resolve localhost even though hosts is empty (FAILED - 1)
  resolve missing localhost even though hosts entries exist (FAILED - 2)

Failures:

  1) DNS resolve localhost even though hosts is empty
     Failure/Error:
       Tempfile.open("empty") do |file|
         expect( Coolio::DNSResolver.hosts("localhost", file.path)).to eq @preferred_localhost_address
       end

     NameError:
       uninitialized constant Tempfile
     # ./spec/dns_spec.rb:46:in 'block (2 levels) in <top (required)>'
...

Types of Changes

  • Maintenance.

Contribution

@Watson1978 Watson1978 merged commit a2a469d into socketry:main Mar 22, 2026
13 of 14 checks passed
@Watson1978 Watson1978 deleted the dns_spec branch March 22, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant