blob: e6c40173ca0bb88a902dfdc250b9b9f55cc6007d (
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
|
require File.expand_path(File.dirname(__FILE__) + '/test_helper')
class AuthTest < Test::Unit::TestCase
def setup
@username = 'user'
@password = 'opensasemi'
@client = SRP::Client.new(@username, @password)
@server = SRP::Server.new(@client.salt, @client.verifier)
end
def test_successful_auth
assert @client.authenticate(@server, @username, @password)
end
def test_wrong_password
assert !@client.authenticate(@server, @username, "password")
end
def test_wrong_username
assert !@client.authenticate(@server, "username", @password)
end
end
|