diff options
author | Russ Allbery <rra@stanford.edu> | 2007-08-30 17:51:08 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2007-08-30 17:51:08 +0000 |
commit | 6d261d9e2b4e95f8d538f47730a25a6d82d34134 (patch) | |
tree | 4e07f027f4949ecd8350612ef42e9e5d87ec10a0 /perl/t/acl.t | |
parent | 40d85c0eacbccc2bb9f8554a3c4607209534cd6e (diff) |
Add a test for renaming to an existing name. Unlink the database before
creating it to protect against previous test failures.
Diffstat (limited to 'perl/t/acl.t')
-rwxr-xr-x | perl/t/acl.t | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/perl/t/acl.t b/perl/t/acl.t index 28dbc84..b88502f 100755 --- a/perl/t/acl.t +++ b/perl/t/acl.t @@ -3,7 +3,7 @@ # # t/api.t -- Tests for the wallet ACL API. -use Test::More tests => 95; +use Test::More tests => 97; use DBD::SQLite; use Wallet::ACL; @@ -13,6 +13,7 @@ use Wallet::Server; # Use a local SQLite database for testing. $Wallet::Config::DB_DRIVER = 'SQLite'; $Wallet::Config::DB_INFO = 'wallet-db'; +unlink 'wallet-db'; # Some global defaults to use. my $admin = 'admin@EXAMPLE.COM'; @@ -75,6 +76,9 @@ ok (defined ($acl), ' and it can still found by ID'); is ($@, '', ' with no exceptions'); is ($acl->name, 'example', ' and the right name'); is ($acl->id, 2, ' and the right ID'); +ok (! $acl->rename ('ADMIN'), ' but renaming to an existing name fails'); +like ($acl->error, qr/^cannot rename ACL 2 to ADMIN: /, + ' with the right error'); # Test add, check, remove, and list. my @entries = $acl->list; |