class BeValidDNSName

Constants

VALID_DNS

stackoverflow.com/questions/106179/regular-expression-to-match-hostname-or-ip-address ftp.rfc-editor.org/in-notes/rfc3696.txt domainkeys.sourceforge.net/underscore.html

Public Instance Methods

failure_message() click to toggle source
# File lib/mspec/matchers/be_valid_dns_name.rb, line 12
def failure_message
  ["Expected '#{@actual}'", "to be a valid DNS name"]
end
matches?(actual) click to toggle source
# File lib/mspec/matchers/be_valid_dns_name.rb, line 7
def matches?(actual)
  @actual = actual
  (VALID_DNS =~ @actual) == 0
end
negative_failure_message() click to toggle source
# File lib/mspec/matchers/be_valid_dns_name.rb, line 16
def negative_failure_message
  ["Expected '#{@actual}'", "not to be a valid DNS name"]
end