diff options
author | Jon Robertson <jonrober@stanford.edu> | 2014-10-14 17:06:43 -0700 |
---|---|---|
committer | Jon Robertson <jonrober@stanford.edu> | 2014-10-14 17:06:43 -0700 |
commit | 1381f2e0d0bb2edfa4b52c9926c57b22379ee248 (patch) | |
tree | 909abb2a5fa9dd8f91e690d1eb9393cb5451835f /perl/t/object | |
parent | b658b799cb10b48d1a5aca19a7e63fe91d2af77a (diff) |
Added rename support for file objects
File objects now support a rename command, which will rename the object
and move the file to the right spot in the file store under its new
name.
Change-Id: I10ea2b8012586d69f0894905cfba54a738f3e418
Diffstat (limited to 'perl/t/object')
-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 { |