Skip to content

Commit

Permalink
removed bad test
Browse files Browse the repository at this point in the history
  • Loading branch information
petdance committed Mar 7, 2009
1 parent b67309c commit 756bdcd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 29 deletions.
6 changes: 5 additions & 1 deletion Changes
@@ -1,9 +1,13 @@
Revision history for Perl-Critic-Bangs

NEXT
1.02 Sat Mar 7 14:40:38 CST 2009
====================================
No new features.

Updated the licensing to be explicitly GPLv3 or Artistic 2.0.

Removed incorrect tests for compatibility with Perl::Critic 1.098.


1.00 Mon May 26 19:10:40 CDT 2008
====================================
Expand Down
29 changes: 2 additions & 27 deletions t/14_policy_parameters.t
Expand Up @@ -11,7 +11,7 @@ use Perl::Critic::PolicyParameter qw{ $NO_DESCRIPTION_AVAILABLE };
use Perl::Critic::Utils qw( policy_short_name );
use Perl::Critic::TestUtils qw(bundled_policy_names);

use Test::More; #plan set below!
use Test::More tests => 12;

Perl::Critic::TestUtils::block_perlcriticrc();

Expand All @@ -27,16 +27,10 @@ Perl::Critic::TestUtils::block_perlcriticrc();
#-----------------------------------------------------------------------------

# Figure out how many tests there will be...
my @all_policies = bundled_policy_names();
my @all_params = map { $_->supported_parameters() } @all_policies;
my $ntests = @all_policies + 2 * @all_params;
plan( tests => $ntests );

#-----------------------------------------------------------------------------
my @all_policies = sort ( bundled_policy_names() );

for my $policy ( @all_policies ) {
test_has_declared_parameters( $policy );
test_invalid_parameters( $policy );
test_supported_parameters( $policy );
}

Expand Down Expand Up @@ -77,25 +71,6 @@ sub test_supported_parameters {

#-----------------------------------------------------------------------------

sub test_invalid_parameters {
my $policy = shift;
my $bogus_params = { bogus => 'shizzle' };
my $profile = Perl::Critic::UserProfile->new( -profile => 'NONE' );
my $factory = Perl::Critic::PolicyFactory->new( -profile => $profile );

my $policy_name = policy_short_name($policy);
my $label = qq{Created $policy_name with bogus parameters};

eval { $factory->create_policy(-name => $policy, -params => $bogus_params) };
like(
$EVAL_ERROR,
qr/The $policy_name policy doesn't take a "bogus" option/,
$label
);
}

#-----------------------------------------------------------------------------

sub test_has_declared_parameters {
my $policy = shift;
if ( not $policy->can('supported_parameters') ) {
Expand Down
1 change: 0 additions & 1 deletion tags
Expand Up @@ -62,7 +62,6 @@ supported_parameters lib/Perl/Critic/Policy/Bangs/ProhibitRefProtoOrProto.pm /^s
supported_parameters lib/Perl/Critic/Policy/Bangs/ProhibitUselessRegexModifiers.pm /^sub supported_parameters { return () }$/;" s
supported_parameters lib/Perl/Critic/Policy/Bangs/ProhibitVagueNames.pm /^sub supported_parameters {$/;" s
test_has_declared_parameters t/14_policy_parameters.t /^sub test_has_declared_parameters {$/;" s
test_invalid_parameters t/14_policy_parameters.t /^sub test_invalid_parameters {$/;" s
test_supported_parameters t/14_policy_parameters.t /^sub test_supported_parameters {$/;" s
violates lib/Perl/Critic/Policy/Bangs/ProhibitCommentedOutCode.pm /^sub violates {$/;" s
violates lib/Perl/Critic/Policy/Bangs/ProhibitFlagComments.pm /^sub violates {$/;" s
Expand Down

0 comments on commit 756bdcd

Please sign in to comment.