Skip to content

Commit

Permalink
remove test checking namespace::autoclean against Test::CleanNamespaces
Browse files Browse the repository at this point in the history
The test was using namespace::autoclean to clean a namespace, then
checking that it was cleaned via Test::CleanNamespaces. This essentially
ends up only being a test of the external modules, not anything about
Moose itself. Both modules are using Moose to get the list of methods.
If that method list was wrong, the test would still pass because the
same list is being provided to both modules. And Moose's tests don't
need to include tests that are only of external modules.
  • Loading branch information
haarg authored and karenetheridge committed Jan 21, 2024
1 parent 181627d commit e79a7d8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ code = s{^(note 'Checking Changes')}{if \(\(\$ENV\{TRAVIS_PULL_REQUEST\} \|\| ''
;authordep warnings = 1.03
[Prereqs / TestRequires]
Test::CleanNamespaces = 0.13
Test::Fatal = 0.001
Test::More = 0.96
Test::Needs = 0.002010
Expand Down
12 changes: 0 additions & 12 deletions t/metaclasses/exporter_sub_names.t
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
use strict;
use warnings;

use Test::CleanNamespaces;
use Test::More;

{
package Metarole;
use Moose::Role;
}

$::HAS_NC_AC = 0;

{
package Foo;
use Moose ();
use Moose::Exporter;
{
local $@;
eval 'use namespace::autoclean; $::HAS_NC_AC = 1';
}

Moose::Exporter->setup_import_methods(
also => 'Moose',
Expand All @@ -33,12 +26,7 @@ $::HAS_NC_AC = 0;
::is( $package, __PACKAGE__, "$name sub is in Foo package" );
::is( $sub_name, $name, "$name sub has that name, not __ANON__" );
}
}

if ($::HAS_NC_AC) {
$INC{'Foo.pm'} = 1;
namespaces_clean('Foo');
}

done_testing();

0 comments on commit e79a7d8

Please sign in to comment.