From e79a7d8f86481cca11f5e9e132720b6d8faf2523 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Sat, 20 Jan 2024 21:48:03 +0100 Subject: [PATCH] remove test checking namespace::autoclean against Test::CleanNamespaces 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. --- dist.ini | 1 - t/metaclasses/exporter_sub_names.t | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/dist.ini b/dist.ini index 83f00cab8..b56dcbc55 100644 --- a/dist.ini +++ b/dist.ini @@ -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 diff --git a/t/metaclasses/exporter_sub_names.t b/t/metaclasses/exporter_sub_names.t index b7a2a3856..a23fef5c5 100644 --- a/t/metaclasses/exporter_sub_names.t +++ b/t/metaclasses/exporter_sub_names.t @@ -1,7 +1,6 @@ use strict; use warnings; -use Test::CleanNamespaces; use Test::More; { @@ -9,16 +8,10 @@ use Test::More; 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', @@ -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(); -