diff options
Diffstat (limited to 't/basic.t')
-rw-r--r-- | t/basic.t | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/t/basic.t b/t/basic.t new file mode 100644 index 0000000..3388e8b --- /dev/null +++ b/t/basic.t @@ -0,0 +1,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; |