root/Log-Dispatch-Config/trunk/t/13_do_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 => 3;
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($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     local $^W;
23     Log::Dispatch::Config->reload;
24     my $disp2 = Log::Dispatch::Config->instance;
25     isa_ok $disp2->{outputs}->{bar}, 'Log::Dispatch::File';
26     isnt "$disp", "$disp2", "same: $disp - $disp2";
27 }
Note: See TracBrowser for help on using the browser.