diff options
author | Rod Montgomery <rmontgomery@dealnews.com> | 2015-01-15 15:10:33 -0600 |
---|---|---|
committer | Rod Montgomery <rmontgomery@dealnews.com> | 2015-03-05 21:51:12 -0600 |
commit | ee13438d2a71cea8a07202eee1eeaa29553b2131 (patch) | |
tree | ccd3d38d60e34a32f8106a9539ffe02ee76cfdcd /spec/functions | |
parent | bf8e5b0573f78f2c2c780494a735bfac25d4488d (diff) |
If present, top-level domain must be alphabetic
See RFC 1123, Section 2.1
http://tools.ietf.org/html/rfc1123#section-2
Diffstat (limited to 'spec/functions')
-rwxr-xr-x | spec/functions/is_domain_name_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/functions/is_domain_name_spec.rb b/spec/functions/is_domain_name_spec.rb index 5ab8369..ef88061 100755 --- a/spec/functions/is_domain_name_spec.rb +++ b/spec/functions/is_domain_name_spec.rb @@ -68,4 +68,14 @@ describe "the is_domain_name function" do result = scope.function_is_domain_name(["my.domain.name".freeze]) expect(result).to(be_truthy) end + + it "should return false if top-level domain is not entirely alphabetic" do + result = scope.function_is_domain_name(["kiwi.2bar"]) + expect(result).to(be_falsey) + end + + it "should return false if domain name has the dotted-decimal form, e.g. an IPv4 address" do + result = scope.function_is_domain_name(["192.168.1.1"]) + expect(result).to(be_falsey) + end end |