summaryrefslogtreecommitdiff
path: root/test/unit/email_address_test.rb
blob: 6aecef779cae689f0e12908c8bcbec3efa0a2df7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'test_helper'
require 'nickserver/email_address'

class EmailAddressTest < Minitest::Test

  def test_domain
    nick = Nickserver::EmailAddress.new 'nick@test.me'
    assert_equal 'test.me', nick.domain
    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