]>
Dogcows Code - chaz/groupsecret/blob - t/02-file.t
8 use Test
::More tests
=> 7;
10 use App
::GroupSecret
::File
;
12 my $nonexistent = App
::GroupSecret
::File-
>new("$Bin/keyfiles/nonexistent.yml");
14 is_deeply
$nonexistent->info, {
18 }, 'newly initialized file is empty';
20 my $empty = App
::GroupSecret
::File-
>new("$Bin/keyfiles/empty.yml");
22 is_deeply
$empty->info, {
26 }, 'empty file info matches';
28 is $empty->secret, undef, 'empty secret is undef';
29 is $empty->version, 1, 'empty version is one';
32 skip
'requires ssh-keygen', 2;
34 my $key1 = $empty->add_key("$Bin/keys/foo_rsa.pub");
37 filename
=> 'foo_rsa.pub',
38 secret_passphrase
=> undef,
40 }, 'add_key in scalar context works';
42 $empty->delete_key('89b3fb766cf9568ea81adfba1cba7d05');
43 is_deeply
$empty->keys, {}, 'file is empty again after delete_key';
46 my $basic = App
::GroupSecret
::File-
>new("$Bin/keyfiles/basic.yml");
48 is_deeply
$basic->keys, {
49 '89b3fb766cf9568ea81adfba1cba7d05' => {
51 filename
=> 'foo_rsa.pub',
52 secret_passphrase
=> undef,
55 }, 'keys accessor works';
This page took 0.03975 seconds and 4 git commands to generate.