From 8597afdc06c05014be9211d2f853432c726b595a Mon Sep 17 00:00:00 2001 From: Brian Cunnie Date: Fri, 9 Sep 2016 13:29:29 -0700 Subject: [PATCH] Tests a more complex and random hostname --- spec/check-dns_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/check-dns_spec.rb b/spec/check-dns_spec.rb index f4c1341..c94553d 100644 --- a/spec/check-dns_spec.rb +++ b/spec/check-dns_spec.rb @@ -52,5 +52,11 @@ describe domain do it "resolves #{a.join("-")}.sslip.io to #{a.join(".")}" do expect(`dig +short #{a.join("-") + "." + domain} @#{whois_nameserver}`.chomp).to eq(a.join(".")) end + + a = [ rand(256), rand(256), rand(256), rand(256) ] + b = [ ('a'..'z').to_a, ('0'..'9').to_a ].flatten.shuffle[0,8].join + it "resolves #{b}.#{a.join("-")}.sslip.io to #{a.join(".")}" do + expect(`dig +short #{b}.#{a.join("-") + "." + domain} @#{whois_nameserver}`.chomp).to eq(a.join(".")) + end end end