[perl-Gtk2] eliminate test failur by using unique temp directory



commit 6bf6ca94426574169747a301e8025db76f6bfcb4
Author: Gabor Szabo <szabgab gmail com>
Date:   Sat Oct 5 17:38:14 2013 +0300

    eliminate test failur by using unique temp directory

 t/GtkRecentManager.t |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/t/GtkRecentManager.t b/t/GtkRecentManager.t
index 93a3b6d..8dc9145 100644
--- a/t/GtkRecentManager.t
+++ b/t/GtkRecentManager.t
@@ -13,6 +13,8 @@
 use strict;
 use warnings;
 use File::Basename qw(basename);
+use File::Temp qw(tempdir);
+my $dir = tempdir(CLEANUP => 1);
 
 use Gtk2::TestHelper tests => 36,
     at_least_version => [2, 10, 0, "GtkRecentManager is new in 2.10"],
@@ -33,8 +35,7 @@ $manager->set_screen(Gtk2::Gdk::Screen->get_default);
 # list, so we use the 'filename' constructor only property of the
 # GtkRecentManager object to create our own test storage file.  this
 # also gives us a better controlled environment. -- ebassi
-unlink './test.xbel'; # in case of an aborted run
-$manager = Glib::Object::new('Gtk2::RecentManager', filename => './test.xbel');
+$manager = Glib::Object::new('Gtk2::RecentManager', filename => "$dir/test.xbel");
 isa_ok($manager, 'Gtk2::RecentManager');
 
 # purge existing items.
@@ -126,9 +127,6 @@ SKIP: {
        ok(!$manager->has_item($icon_uri), 'check remove item');
 
        is($manager->purge_items, 0, 'check purge items');
-
-       unlink './test.xbel' or
-               die "Unable to remove the test storage file";
 }
 
 __END__


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]