summaryrefslogtreecommitdiff
path: root/test/unit/email_address_test.rb
blob: 6d57a8cff1d2723890aae5f8b664384b0c5d2e05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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