summaryrefslogtreecommitdiff
path: root/test/unit/nickname_test.rb
blob: 868154595e00178c39e83fd0766db7accff758ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'test_helper'
require 'nickserver/nickname'

class NicknameTest < Minitest::Test

  def test_local
    nick = Nickserver::Nickname.new 'nick@test.me'
    assert nick.local?
    assert !nick.remote?
  end

  def test_remote
    nick = Nickserver::Nickname.new 'nick@remote.domain'
    assert !nick.local?
    assert nick.remote?
  end

  def test_valid
    nick = Nickserver::Nickname.new 'nick@remote.domain'
    assert nick.valid?
  end

  def test_invalid
    nick = Nickserver::Nickname.new 'asdf'
    assert nick.invalid?
  end

end