summaryrefslogtreecommitdiff
path: root/test/unit/email_address_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/email_address_test.rb')
-rw-r--r--test/unit/email_address_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/email_address_test.rb b/test/unit/email_address_test.rb
new file mode 100644
index 0000000..6d57a8c
--- /dev/null
+++ b/test/unit/email_address_test.rb
@@ -0,0 +1,22 @@
+require 'test_helper'
+require 'nickserver/email_address'
+
+class EmailAddressTest < Minitest::Test
+
+ def test_domain
+ nick = Nickserver::EmailAddress.new 'nick@test.me'
+ assert nick.domain?('test.me')
+ assert !nick.domain?('est.me')
+ end
+
+ def test_valid
+ nick = Nickserver::EmailAddress.new 'nick@remote.domain'
+ assert nick.valid?
+ end
+
+ def test_invalid
+ nick = Nickserver::EmailAddress.new 'asdf'
+ assert nick.invalid?
+ end
+
+end