diff options
author | Russ Allbery <eagle@eyrie.org> | 2014-12-08 20:57:57 -0800 |
---|---|---|
committer | Russ Allbery <eagle@eyrie.org> | 2014-12-08 20:57:57 -0800 |
commit | 7856dc7cc5e16140c0084474fe54338f293bf77e (patch) | |
tree | 5948678fb9c0a30b7d72057c9952ac8836ae2499 /perl/t/object/file.t | |
parent | dd295a55a6f02e7585a9f5be9e8b434c6d14d040 (diff) | |
parent | e73a80c6bc23f16544c35e7dc3bf61ca9292c3b5 (diff) |
Imported Upstream version 1.2upstream/1.2
Diffstat (limited to 'perl/t/object/file.t')
-rwxr-xr-x | perl/t/object/file.t | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/perl/t/object/file.t b/perl/t/object/file.t index 201f46d..b7f295a 100755 --- a/perl/t/object/file.t +++ b/perl/t/object/file.t @@ -12,7 +12,7 @@ use strict; use warnings; use POSIX qw(strftime); -use Test::More tests => 56; +use Test::More tests => 60; use Wallet::Admin; use Wallet::Config; @@ -101,9 +101,15 @@ is ($object->error, 'data exceeds maximum of 1024 bytes', is ($object->store ('', @trace), 1, 'Storing the empty object works'); is ($object->get (@trace), '', ' and get returns the right thing'); +# Test renaming a file object. +is ($object->rename ('test-rename', @trace), 1, 'Renaming the object works'); +is ($object->{name}, 'test-rename', ' and the object is renamed'); +ok (-f 'test-files/2b/test-rename', ' and the file is in the new location'); +ok (! -f 'test-files/09/test', ' and nothing is in the old location'); + # Test destruction. is ($object->destroy (@trace), 1, 'Destroying the object works'); -ok (! -f 'test-files/09/test', ' and the file is gone'); +ok (! -f 'test-files/2b/test-rename', ' and the file is gone'); # Now try some aggressive names. $object = eval { |