Skip to content

Commit

Permalink
Change DNS matcher to allow underscores. Caused failing specs if you'…
Browse files Browse the repository at this point in the history
…ve got certain things in your hosts file
  • Loading branch information
erik-megarad committed Mar 18, 2012
1 parent 1e6efe2 commit 76f21f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mspec/lib/mspec/matchers/be_valid_dns_name.rb
@@ -1,7 +1,8 @@
class BeValidDNSName
# http://stackoverflow.com/questions/106179/regular-expression-to-match-hostname-or-ip-address
# ftp://ftp.rfc-editor.org/in-notes/rfc3696.txt
VALID_DNS = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])\.?$/
# http://domainkeys.sourceforge.net/underscore.html
VALID_DNS = /^(([a-zA-Z0-9_]|[a-zA-Z0-9_][a-zA-Z0-9\-_]*[a-zA-Z0-9_])\.)*([A-Za-z_]|[A-Za-z_][A-Za-z0-9\-_]*[A-Za-z0-9_])\.?$/

def matches?(actual)
@actual = actual
Expand Down

0 comments on commit 76f21f8

Please sign in to comment.