[Rt-commit] [svn] r1772 - in Module-Refresh: . lib/Module t

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Wed Nov 10 03:48:38 EST 2004


Author: jesse
Date: Wed Nov 10 03:48:37 2004
New Revision: 1772

Modified:
   Module-Refresh/   (props changed)
   Module-Refresh/Makefile
   Module-Refresh/lib/Module/Refresh.pm
   Module-Refresh/t/1api.t
   Module-Refresh/t/1api.t~
Log:
 r8981 at tinbook:  jesse | 2004-11-10T08:48:47.898856Z
 More tests that fail!
 


Modified: Module-Refresh/Makefile
==============================================================================
--- Module-Refresh/Makefile	(original)
+++ Module-Refresh/Makefile	Wed Nov 10 03:48:37 2004
@@ -431,7 +431,7 @@
 realclean purge ::  clean realclean_subdirs
 	$(RM_RF) $(INST_AUTODIR) $(INST_ARCHAUTODIR)
 	$(RM_RF) $(DISTVNAME)
-	$(RM_F)  $(FIRST_MAKEFILE) $(MAKEFILE_OLD) blib/lib/Module/Refresh.pm
+	$(RM_F)  $(MAKEFILE_OLD) blib/lib/Module/Refresh.pm $(FIRST_MAKEFILE)
 
 
 # --- MakeMaker metafile section:

Modified: Module-Refresh/lib/Module/Refresh.pm
==============================================================================
--- Module-Refresh/lib/Module/Refresh.pm	(original)
+++ Module-Refresh/lib/Module/Refresh.pm	Wed Nov 10 03:48:37 2004
@@ -126,6 +126,22 @@
     return ( stat($filename) )[9];
 }
 
+
+=head2 cleanup_subs filename
+
+Wipe out  subs defined in $file.
+
+
+=cut
+
+
+sub cleanup_subs {
+
+    my $self = shift;
+    my $file = shift;
+}
+
+
 =head1 BUGS
 
 The module warns for each reloaded subroutine.  We _could_ 

Modified: Module-Refresh/t/1api.t
==============================================================================
--- Module-Refresh/t/1api.t	(original)
+++ Module-Refresh/t/1api.t	Wed Nov 10 03:48:37 2004
@@ -14,6 +14,11 @@
 
 use_ok('FooBar', "Required our dummy module");
 
+# is our non-file-based method available?
+
+can_ok('Foo::Bar', 'not_in_foobarpm');
+
+
 is(Foo::Bar->foo, 'bar', "We got the right result");
 
 `echo "package Foo::Bar; sub foo { 'baz'}\n1;" > /tmp/FooBar.pm`;
@@ -24,8 +29,25 @@
 
 is(Foo::Bar->foo, 'baz', "We got the right new result,");
 
+# After a refresh, did we blow away our non-file-based comp?
+can_ok('Foo::Bar', 'not_in_foobarpm');
+
 delete $INC{'FooBar.pm'};
+
+ok(!UNIVERSAL::can('Foo::Bar', 'foo'), "We cleaned out the 'foo' method'");
+
 require "FooBar.pm";
 
 is(Foo::Bar->foo, 'baz', "We got the right new result,");
 
+
+
+package Foo::Bar;
+
+sub not_in_foobarpm {
+    return "woo";
+}
+
+1;
+
+

Modified: Module-Refresh/t/1api.t~
==============================================================================
--- Module-Refresh/t/1api.t~	(original)
+++ Module-Refresh/t/1api.t~	Wed Nov 10 03:48:37 2004
@@ -14,18 +14,40 @@
 
 use_ok('FooBar', "Required our dummy module");
 
+# is our non-file-based method available?
+
+can_ok('Foo::Bar', 'not_in_foobarpm');
+
+
 is(Foo::Bar->foo, 'bar', "We got the right result");
 
 `echo "package Foo::Bar; sub foo { 'baz'}\n1;" > /tmp/FooBar.pm`;
 is(Foo::Bar->foo, 'bar', "We got the right result, still");
 
-$r->reload_updated;
+$r->refresh_updated;
 sleep (2); # we only have second-level granularity
 
 is(Foo::Bar->foo, 'baz', "We got the right new result,");
 
+# After a refresh, did we blow away our non-file-based comp?
+can_ok('Foo::Bar', 'not_in_foobarpm');
+
 delete $INC{'FooBar.pm'};
+
+ok(!UNIVERSAL::can('Foo::Bar', 'foo'), "We cleaned out the 'foo' method'");
+
 require "FooBar.pm";
 
 is(Foo::Bar->foo, 'baz', "We got the right new result,");
 
+
+
+package Foo::Bar;
+
+sub not_in_foobarpm {
+    return "woo";
+}
+
+1;
+
+


More information about the Rt-commit mailing list