From f1a8c9da8bbc2aa85b98fcd4880a1de633c7506e Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 5 Apr 2011 21:26:11 -0500 Subject: nonmoose test --- t/basic.t | 29 +++++++++++++++++++++++++++++ t/data/basic/after/Foo.pm | 5 +++++ t/data/basic/before/Foo.pm | 5 +++++ 3 files changed, 39 insertions(+) create mode 100644 t/basic.t create mode 100644 t/data/basic/after/Foo.pm create mode 100644 t/data/basic/before/Foo.pm 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; -- cgit v1.2.3-54-g00ecf