summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-17 14:42:25 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-17 14:42:25 +0200
commit9f84c2ba374a07fcf12fdf41c0d6f1fc3f315655 (patch)
tree04e499e55236909676318be4ca69286fb6ada9bd /t
parent391929448038a478f23cfa28db528e1f4a1e60d9 (diff)
Move create_salt to App::Raps2::Password, make $pw->salt() return current salt
Diffstat (limited to 't')
-rw-r--r--t/20-app-raps2-password.t26
-rw-r--r--t/29-app-raps2.t4
2 files changed, 3 insertions, 27 deletions
diff --git a/t/20-app-raps2-password.t b/t/20-app-raps2-password.t
index ae4f267..5faa7e9 100644
--- a/t/20-app-raps2-password.t
+++ b/t/20-app-raps2-password.t
@@ -3,7 +3,7 @@ use strict;
use warnings;
use 5.010;
-use Test::More tests => 19;
+use Test::More tests => 17;
use Test::Fatal;
my $pw;
@@ -16,14 +16,6 @@ like(
exception {
App::Raps2::Password->new();
},
- qr{incorrect salt length},
- 'new() missing salt and passphrase'
-);
-
-like(
- exception {
- App::Raps2::Password->new(salt => $salt);
- },
qr{no passphrase given},
'new() missing passphrase'
);
@@ -41,14 +33,6 @@ like(
like(
exception {
- App::Raps2::Password->new(passphrase => $pass);
- },
- qr{incorrect salt length},
- 'new() missing salt'
-);
-
-like(
- exception {
App::Raps2::Password->new(
passphrase => $pass,
salt => 'abcdefghijklmno',
@@ -100,13 +84,7 @@ like(
ok($pw->verify($pw->crypt('truth')), 'crypt->verify okay');
-like(
- exception {
- $pw->salt();
- },
- qr{incorrect salt length},
- 'salt: No argument',
-);
+is($pw->salt(), $salt, 'salt() returns current salt');
like(
exception {
diff --git a/t/29-app-raps2.t b/t/29-app-raps2.t
index ceaaf51..8034791 100644
--- a/t/29-app-raps2.t
+++ b/t/29-app-raps2.t
@@ -3,7 +3,7 @@ use strict;
use warnings;
use 5.010;
-use Test::More tests => 4;
+use Test::More tests => 3;
use Test::Fatal;
use_ok('App::Raps2');
@@ -11,8 +11,6 @@ use_ok('App::Raps2');
my $r2 = App::Raps2->new();
isa_ok($r2, 'App::Raps2');
-is(length($r2->create_salt()), 16, 'create_salt: correct length');
-
is_deeply(
{ $r2->file_to_hash('t/in/hash') },
{ key => 'value', otherkey => 'othervalue' },