[Rt-commit] [svn] r1781 - in Module-Refresh: lib/Module t
autrijus at pallas.eruditorum.org
autrijus at pallas.eruditorum.org
Wed Nov 10 05:26:07 EST 2004
Author: autrijus
Date: Wed Nov 10 05:26:07 2004
New Revision: 1781
Modified:
Module-Refresh/lib/Module/Refresh.pm
Module-Refresh/t/1api.t
Log:
* ->cleanup_subs now actually work as advertised. :)
Modified: Module-Refresh/lib/Module/Refresh.pm
==============================================================================
--- Module-Refresh/lib/Module/Refresh.pm (original)
+++ Module-Refresh/lib/Module/Refresh.pm Wed Nov 10 05:26:07 2004
@@ -131,10 +131,14 @@
my $file = shift;
# Find all the entries in %DB::sub whose keys match "$file:" and wack em
- foreach my $sym ( grep { $DB::sub{$_} =~ qr{^\Q$file:\E} } keys %DB::sub ) {
- warn $sym;
- undef &{$sym};
+ foreach my $sym (
+ grep { index( $DB::sub{$_}, "$file:" ) == 0 } keys %DB::sub
+ ) {
+ undef &$sym;
+ delete $DB::sub{$sym};
}
+
+ return ($self);
}
=head1 BUGS
Modified: Module-Refresh/t/1api.t
==============================================================================
--- Module-Refresh/t/1api.t (original)
+++ Module-Refresh/t/1api.t Wed Nov 10 05:26:07 2004
@@ -43,13 +43,12 @@
# After a refresh, did we blow away our non-file-based comp?
can_ok('Foo::Bar', 'not_in_foobarpm');
-delete $INC{'FooBar.pm'};
+$r->cleanup_subs($module);
+ok(!defined(&Foo::Bar::foo), "We cleaned out the 'foo' method'");
-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,");
+#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,");
sub write_out {
local *FH;
More information about the Rt-commit
mailing list