diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-04-05 21:26:11 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-04-05 21:26:11 -0500 |
commit | f1a8c9da8bbc2aa85b98fcd4880a1de633c7506e (patch) | |
tree | 0c553cb72cdd2dd48e941ba6b1da5e5731eaabd5 | |
parent | 0e7e5666c8267fdc505877c838f4f07b082f350c (diff) | |
download | class-refresh-f1a8c9da8bbc2aa85b98fcd4880a1de633c7506e.tar.gz class-refresh-f1a8c9da8bbc2aa85b98fcd4880a1de633c7506e.zip |
nonmoose test
-rw-r--r-- | t/basic.t | 29 | ||||
-rw-r--r-- | t/data/basic/after/Foo.pm | 5 | ||||
-rw-r--r-- | t/data/basic/before/Foo.pm | 5 |
3 files changed, 39 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; diff --git a/t/data/basic/after/Foo.pm b/t/data/basic/after/Foo.pm new file mode 100644 index 0000000..b9c85eb --- /dev/null +++ b/t/data/basic/after/Foo.pm @@ -0,0 +1,5 @@ +package Foo; + +sub other_meth { } + +1; diff --git a/t/data/basic/before/Foo.pm b/t/data/basic/before/Foo.pm new file mode 100644 index 0000000..11641b4 --- /dev/null +++ b/t/data/basic/before/Foo.pm @@ -0,0 +1,5 @@ +package Foo; + +sub meth { } + +1; |