mirror of
https://github.com/cunnie/sslip.io.git
synced 2025-10-05 07:36:54 +08:00
Tests a more complex and random hostname
This commit is contained in:
@@ -52,5 +52,11 @@ describe domain do
|
|||||||
it "resolves #{a.join("-")}.sslip.io to #{a.join(".")}" do
|
it "resolves #{a.join("-")}.sslip.io to #{a.join(".")}" do
|
||||||
expect(`dig +short #{a.join("-") + "." + domain} @#{whois_nameserver}`.chomp).to eq(a.join("."))
|
expect(`dig +short #{a.join("-") + "." + domain} @#{whois_nameserver}`.chomp).to eq(a.join("."))
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user