diff options
author | Russ Allbery <rra@stanford.edu> | 2008-01-23 03:33:41 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2008-01-23 03:33:41 +0000 |
commit | 77b6875f95aa54fe9c648ba114e06d85cf655bb1 (patch) | |
tree | 27a3ce2238ed38894e68ef7242a3b2a71c5e6cdc /perl/t/acl.t | |
parent | d94cac7f73b8a0c0a067bc179747426726ab8c31 (diff) |
Refactor database initialization into a new Wallet::Admin module.
Diffstat (limited to 'perl/t/acl.t')
-rwxr-xr-x | perl/t/acl.t | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/perl/t/acl.t b/perl/t/acl.t index 16af5c1..15796d2 100755 --- a/perl/t/acl.t +++ b/perl/t/acl.t @@ -4,7 +4,7 @@ # t/api.t -- Tests for the wallet ACL API. # # Written by Russ Allbery <rra@stanford.edu> -# Copyright 2007 Board of Trustees, Leland Stanford Jr. University +# Copyright 2007, 2008 Board of Trustees, Leland Stanford Jr. University # # See LICENSE for licensing terms. @@ -12,6 +12,7 @@ use POSIX qw(strftime); use Test::More tests => 101; use Wallet::ACL; +use Wallet::Admin; use Wallet::Config; use Wallet::Server; @@ -25,12 +26,12 @@ my $user2 = 'bob@EXAMPLE.COM'; my $host = 'localhost'; my @trace = ($admin, $host, time); -# Use Wallet::Server to set up the database. +# Use Wallet::Admin to set up the database. db_setup; -my $server = eval { Wallet::Server->reinitialize ($admin) }; -is ($@, '', 'Database initialization did not die'); -ok ($server->isa ('Wallet::Server'), ' and returned the right class'); -my $dbh = $server->dbh; +my $setup = eval { Wallet::Admin->new }; +is ($@, '', 'Database connection succeeded'); +is ($setup->reinitialize ($setup), 1, 'Database initialization succeeded'); +my $dbh = $setup->dbh; # Test create and new. my $acl = eval { Wallet::ACL->create ('test', $dbh, @trace) }; |