root/Log-Dispatch-Config/trunk/t/03_reload.t

Revision 463 (checked in by miyagawa, 18 years ago)

clean up tests

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 use strict;
2 use Test::More tests => 4;
3
4 use Log::Dispatch::Config;
5 use FileHandle;
6 use File::Copy;
7 use File::Temp qw(tempfile);
8 use IO::Scalar;
9
10 my($fh, $file) = tempfile;
11 copy("t/foo.cfg", $file);
12
13 Log::Dispatch::Config->configure_and_watch($file);
14
15 {
16     my $disp = Log::Dispatch::Config->instance;
17     isa_ok $disp->{outputs}->{foo}, 'Log::Dispatch::File';
18
19     sleep 1;
20
21     copy("t/bar.cfg", $file);
22
23     local $^W;
24     my $disp2 = Log::Dispatch::Config->instance;
25     isa_ok $disp2->{outputs}->{bar}, 'Log::Dispatch::File';
26     is $disp2->{outputs}->{foo}, undef;
27     isnt "$disp", "$disp2", "$disp - $disp2";
28 }
Note: See TracBrowser for help on using the browser.