From 68378665be58b2dfa78267a904716ffb8378f230 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 15 May 2009 09:54:08 -0700 Subject: [PATCH] getPathClassDir tests --- t/FilePump/Bundle.t | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/t/FilePump/Bundle.t b/t/FilePump/Bundle.t index d684c9ff4..7d0c1748c 100644 --- a/t/FilePump/Bundle.t +++ b/t/FilePump/Bundle.t @@ -32,7 +32,7 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -my $tests = 31; # Increment this number for each test you create +my $tests = 35; # Increment this number for each test you create plan tests => 1 + $tests; # 1 for the use_ok #---------------------------------------------------------------------------- @@ -277,6 +277,30 @@ cmp_deeply( 'fetchFile: retrieved a file from the filesystem' ); +################################################################### +# +# getPathClassDir +# +################################################################### + +my $dir = $bundle->getPathClassDir(); +isa_ok($dir, 'Path::Class::Dir'); +my $timestampDir = $dir->dir_list(-1, 1); +cmp_deeply( + [ split /\./, $timestampDir ], + [ 'new-bundle', 0 ], + '... directory has correct name and timestamp' +); + +$dir = $bundle->getPathClassDir(997966800); +isa_ok($dir, 'Path::Class::Dir'); +$timestampDir = $dir->dir_list(-1, 1); +cmp_deeply( + [ split /\./, $timestampDir ], + [ 'new-bundle', 997966800 ], + '... directory has correct name and timestamp when timestamp is specified' +); + ################################################################### # # build