]> Dogcows Code - chaz/p5-File-KDBX/blobdiff - t/entry.t
Fill out recycle bin functionality
[chaz/p5-File-KDBX] / t / entry.t
index 6de80287b9974251d272b644971f22a824d6ac3d..988e71214c0ba441315798fb12bfcc2cfe24cb6a 100644 (file)
--- a/t/entry.t
+++ b/t/entry.t
@@ -18,7 +18,7 @@ subtest 'Construction' => sub {
     is $entry->{username}, 'foo', 'username is in the object still';
     is $entry->username, '', 'username is not the UserName string';
 
-    like exception { $entry->kdbx }, qr/disassociated from a KDBX database/, 'Dies if disassociated';
+    like exception { $entry->kdbx }, qr/disconnected/, 'Dies if disconnected';
     $entry->kdbx(my $kdbx = File::KDBX->new);
     is $entry->kdbx, $kdbx, 'Set a database after instantiation';
 
@@ -73,6 +73,14 @@ subtest 'Construction' => sub {
     }), 'Entry data contains UserName string and the rest default attributes';
 };
 
+subtest 'Accessors' => sub {
+    my $entry = File::KDBX::Entry->new;
+
+    $entry->creation_time('2022-02-02 12:34:56');
+    cmp_ok $entry->creation_time, '==', 1643805296, 'Creation time coerced into a Time::Piece (epoch)';
+    is $entry->creation_time->datetime, '2022-02-02T12:34:56', 'Creation time coerced into a Time::Piece';
+};
+
 subtest 'Custom icons' => sub {
     plan tests => 10;
     my $gif = pack('H*', '4749463839610100010000ff002c00000000010001000002003b');
This page took 0.024964 seconds and 4 git commands to generate.