Skip to content

Commit eeba3a2

Browse files
committed
actually check that a domains dns resolves
1 parent 6108e03 commit eeba3a2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/github-pages-health-check.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def dns
8181

8282
# Are we even able to get the DNS record?
8383
def dns?
84-
!dns.nil?
84+
!dns.nil? && !dns.empty?
8585
end
8686
alias_method :dns_resolves?, :dns
8787

spec/github_pages_health_check_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,5 +293,10 @@ def cname_packet(domain)
293293
allow(health_check).to receive(:dns) { nil }
294294
expect(health_check.dns?).to be(false)
295295
end
296+
297+
it "knows when a domain has no record" do
298+
allow(health_check).to receive(:domain) { "example.invalid" }
299+
expect(health_check.dns?).to be(false)
300+
end
296301
end
297302
end

0 commit comments

Comments
 (0)