From: Graham Knop Date: Sat, 13 Jul 2013 20:21:19 +0000 (-0400) Subject: don't use Base as a package name in tests to avoid conflict with base.pm X-Git-Tag: v1.003000~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f3e87eb430b19b31443c65b5a6ca3a9e6a94967a;p=gitmo%2FRole-Tiny.git don't use Base as a package name in tests to avoid conflict with base.pm --- diff --git a/t/compose-modifiers.t b/t/compose-modifiers.t index 0dde333..890391e 100644 --- a/t/compose-modifiers.t +++ b/t/compose-modifiers.t @@ -16,7 +16,7 @@ BEGIN { around foo => sub { my $orig = shift; (__PACKAGE__, $orig->(@_)) }; package Four; use Role::Tiny; around foo => sub { my $orig = shift; (__PACKAGE__, $orig->(@_)) }; - package Base; sub foo { __PACKAGE__ } + package BaseClass; sub foo { __PACKAGE__ } } foreach my $combo ( @@ -24,12 +24,12 @@ foreach my $combo ( [ qw(Two Four Three) ], [ qw(One Two) ] ) { - my $combined = Role::Tiny->create_class_with_roles('Base', @$combo); + my $combined = Role::Tiny->create_class_with_roles('BaseClass', @$combo); is_deeply( - [ $combined->foo ], [ reverse(@$combo), 'Base' ], + [ $combined->foo ], [ reverse(@$combo), 'BaseClass' ], "${combined} ok" ); - my $object = bless({}, 'Base'); + my $object = bless({}, 'BaseClass'); Role::Tiny->apply_roles_to_object($object, @$combo); is(ref($object), $combined, 'Object reblessed into correct class'); } @@ -43,7 +43,7 @@ foreach my $combo ( is eval { package WithFive; use Role::Tiny::With; - use base 'Base'; + use base 'BaseClass'; with 'Five'; }, undef, "composing an around modifier fails when method doesn't exist"; diff --git a/t/role-duplication.t b/t/role-duplication.t index 124909d..b44629c 100644 --- a/t/role-duplication.t +++ b/t/role-duplication.t @@ -5,10 +5,10 @@ use Test::More; { package Role; use Role::Tiny; sub foo { my $orig = shift; 1 + $orig->(@_) }; - package Base; sub foo { 1 } + package BaseClass; sub foo { 1 } } -eval { Role::Tiny->create_class_with_roles('Base', qw(Role Role)); }; +eval { Role::Tiny->create_class_with_roles('BaseClass', qw(Role Role)); }; like $@, qr/Duplicated/, 'duplicate role detected';