summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-07-23 10:17:58 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-07-23 10:17:58 +0200
commit87b6ff984766ad5d0bd4a78f53e48d43d24eac55 (patch)
treed3c098eba01038149f0cbab15b51e28e68c6e29a
parent5f3ac17a401f9c6b99f9df2a4fc078c37764d02a (diff)
Add generate_password test
-rw-r--r--t/29-app-raps2.t17
1 files changed, 13 insertions, 4 deletions
diff --git a/t/29-app-raps2.t b/t/29-app-raps2.t
index ab9a294..c90e40c 100644
--- a/t/29-app-raps2.t
+++ b/t/29-app-raps2.t
@@ -3,25 +3,32 @@ use strict;
use warnings;
use 5.010;
-use Test::More tests => 11;
+use Test::More tests => 12;
$ENV{XDG_CONFIG_HOME} = 't/config';
$ENV{XDG_DATA_HOME} = 't/data';
use_ok('App::Raps2');
-my $r2 = App::Raps2->new( master_password => 'sekrit', no_cli => 1 );
+my $r2 = App::Raps2->new(
+ master_password => 'sekrit',
+ no_cli => 1,
+ pwgen_cmd => 'echo 123 456',
+);
isa_ok( $r2, 'App::Raps2' );
ok( -e 't/config/raps2/password', 'config file created' );
is_deeply(
$r2->file_to_hash('t/in/hash'),
- { key => 'value', otherkey => 'othervalue' },
+ {
+ key => 'value',
+ otherkey => 'othervalue'
+ },
'file_to_hash works',
);
-is ($r2->ui, undef, 'no_cli works (no UI object created)');
+is( $r2->ui, undef, 'no_cli works (no UI object created)' );
$r2->pw_save(
password => 'foopass',
@@ -53,6 +60,8 @@ is( $r2->pw_load( file => 't/data/raps2/test2' )->{password},
is( $r2->pw_load( file => 't/data/raps2/test2' )->{extra},
'mextra', 'Extra for test2 loaded ok' );
+is ( $r2->generate_password(), '123', 'generate_password + pwgen_cmd ok' );
+
unlink('t/data/raps2/test1');
unlink('t/data/raps2/test2');
unlink('t/config/raps2/password');