Skip to content

Instantly share code, notes, and snippets.

@miyagawa
Created March 9, 2009 04:45
Show Gist options
  • Save miyagawa/76110 to your computer and use it in GitHub Desktop.
Save miyagawa/76110 to your computer and use it in GitHub Desktop.
Index: t/02_directories.t
===================================================================
--- t/02_directories.t (revision 5523)
+++ t/02_directories.t (working copy)
@@ -74,8 +74,8 @@
if ($^O eq 'darwin') {
eval 'use Mac::Glue ();';
skip "Undelete support requires Mac::Glue", 0 if length $@;
- eval 'use Mac::Glue::Finder ();';
- skip "Undelete support requires Mac::Glue::Finder", 0 if length $@;
+ eval 'Mac::Glue->new("Finder")';
+ skip "Undelete support requires Mac::Glue with Finder support", 0 if length $@;
} elsif ($^O eq 'cygwin' || $^O =~ /^MSWin/) {
eval 'use Win32::FileOp::Recycle;';
skip "Undelete support requires Win32::FileOp::Recycle", 0 if length $@;
@@ -136,7 +136,8 @@
for my $path (reverse @dirs) {
ok( -e $path, "-e: $path" );
ok(
- eval { trash({ 'rmdir' => sub { 1 }, 'unlink' => sub { 1 } }, $path) },
+ # fake callbacks will not remove directories, so trash() would return empty list
+ eval { trash({ 'rmdir' => sub { 1 }, 'unlink' => sub { 1 } }, $path); 1 },
"trash: $path",
);
ok( -e $path, "-e: $path" );
Index: lib/File/Remove.pm
===================================================================
--- lib/File/Remove.pm (revision 5523)
+++ lib/File/Remove.pm (working copy)
@@ -199,7 +199,7 @@
die "Support for trash() on platform '$^O' not available at this time.\n";
}
- goto &remove;
+ remove(@_);
}
sub undelete (@) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment