test stash_name in less.pm
authorRicardo Signes <rjbs@cpan.org>
Tue, 12 Jan 2010 16:12:47 +0000 (11:12 -0500)
committerDavid Golden <dagolden@cpan.org>
Tue, 12 Jan 2010 16:46:55 +0000 (11:46 -0500)
lib/less.t

index 3cca6fa..7713eb6 100644 (file)
@@ -5,15 +5,30 @@ BEGIN {
     push @INC, '../lib';
 }
 
-use Test::More tests => 6;
+use Test::More tests => 12;
 
-BEGIN { use_ok( 'less' ) }
+BEGIN {
+    use_ok( 'less' );
+
+    package less::again;
+    sub stash_name {'less'}
+    @ISA = 'less';
+    $INC{'less/again.pm'} = 1;
+}
 
 is_deeply([less->of], [], 'more please');
 use less;
 is_deeply([less->of], ['please'],'less please');
+is_deeply([less::again->of], ['please'], 'less::again please');
 no less;
 is_deeply([less->of],[],'more please');
+is_deeply([less::again->of], [], 'no less::again please');
+use less::again;
+is_deeply([less->of], ['please'],'less please');
+is_deeply([less::again->of], ['please'], 'less::again please');
+no less::again;
+is_deeply([less->of],[],'more please');
+is_deeply([less::again->of], [], 'no less::again please');
 
 use less 'random acts';
 is_deeply([sort less->of],[sort qw(random acts)],'less random acts');