OSDN Git Service

Changed the directory name
[shogi-server/shogi-server.git] / test / TC_player.rb
1 require 'test/unit'
2 load '../shogi-server/shogi-server'
3
4 class TestPlayer < Test::Unit::TestCase
5   def setup
6     @p = ShogiServer::BasicPlayer.new
7   end
8
9   def test_without_password
10     @p.name = "hoge"
11     @p.set_password(nil)
12     assert_nil(@p.player_id)
13   end
14   
15   def test_set_password
16     @p.name = "hoge"
17     @p.set_password("abc")
18     assert(@p.player_id)
19   end
20
21   def test_name_atmark
22     @p.name = "hoge@p1"
23     @p.set_password("abc")
24     assert_match(/@/, @p.player_id)
25   end
26
27   def test_rating_group
28     assert_nothing_raised {@p.rating_group = 1}
29   end
30 end
31