summaryrefslogtreecommitdiffstats
path: root/t/basic.t
blob: 3388e8bdbe9541edef39cbf17d077e36f4b73cf5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use lib 't/lib';
use Test::Class::Refresh;

use Class::Refresh;

my $dir = prepare_temp_dir_for('basic');
push @INC, $dir->dirname;

require Foo;

Class::Refresh->refresh;

can_ok('Foo', 'meth');
ok(!Foo->can('other_meth'), "!Foo->can('other_meth')");


sleep 2;
update_temp_dir_for('basic', $dir);

Class::Refresh->refresh;

can_ok('Foo', 'other_meth');
ok(!Foo->can('meth'), "!Foo->can('meth')");

done_testing;