Tidy up help and TODO tests
Tomas Doran [Thu, 26 Nov 2009 01:02:52 +0000 (01:02 +0000)]
TODO.scripts [deleted file]
lib/Catalyst/Script/CGI.pm
lib/Catalyst/Script/Create.pm
lib/Catalyst/Script/FastCGI.pm
lib/Catalyst/Script/Server.pm
lib/Catalyst/Script/Test.pm
lib/Catalyst/ScriptRole.pm
t/aggregate/unit_core_script_help.t

diff --git a/TODO.scripts b/TODO.scripts
deleted file mode 100644 (file)
index 7e779d7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-* Fix TODO tests
index 2fd965c..c37dfdc 100644 (file)
@@ -5,8 +5,6 @@ use namespace::autoclean;
 
 with 'Catalyst::ScriptRole';
 
-__PACKAGE__->meta->get_attribute('help')->cmd_aliases('h');
-
 __PACKAGE__->meta->make_immutable;
 
 =head1 NAME
index ab85ded..361aa26 100644 (file)
@@ -5,8 +5,6 @@ use namespace::autoclean;
 
 with 'Catalyst::ScriptRole';
 
-__PACKAGE__->meta->get_attribute('help')->cmd_aliases('h');
-
 has force => (
     traits => [qw(Getopt)],
     cmd_aliases => 'nonew',
index ba7f096..11bc735 100644 (file)
@@ -7,8 +7,6 @@ use namespace::autoclean;
 
 with 'Catalyst::ScriptRole';
 
-__PACKAGE__->meta->get_attribute('help')->cmd_aliases('h');
-
 has listen => (
     traits => [qw(Getopt)],
     cmd_aliases => 'l',
index ef1f818..22bafcb 100644 (file)
@@ -11,6 +11,8 @@ use namespace::autoclean;
 
 with 'Catalyst::ScriptRole';
 
+__PACKAGE__->meta->get_attribute('help')->cmd_aliases('?');
+
 has debug => (
     traits => [qw(Getopt)],
     cmd_aliases => 'd',
index 1416bd4..268b1cd 100644 (file)
@@ -5,8 +5,6 @@ use namespace::autoclean;
 
 with 'Catalyst::ScriptRole';
 
-__PACKAGE__->meta->get_attribute('help')->cmd_aliases('h');
-
 sub run {
     my $self = shift;
 
index bef547a..089f2df 100644 (file)
@@ -25,6 +25,7 @@ has help => (
     isa => Bool,
     is => 'ro',
     documentation => q{Display this help and exit},
+    cmd_aliases => ['?', 'h'],
 );
 
 sub _getopt_spec_exception {}
index 2b6530a..0287990 100644 (file)
@@ -11,26 +11,21 @@ use lib "$Bin/../lib";
     package TestHelpScript;
     use Moose;
     with 'Catalyst::ScriptRole';
-    __PACKAGE__->meta->get_attribute('help')->cmd_aliases('h');
     our $help;
-    sub _exit_with_usage { $help++ }
+    sub _getopt_full_usage { $help++ }
 }
 
 test('-h');
 test('--help');
-
-TODO: {
-    local $TODO = 'This is bork';
-    test('-?');
-}
+test('-?');
 
 sub test {
     local $TestHelpScript::help;
     local @ARGV = (@_);
     lives_ok {
         TestHelpScript->new_with_options(application_name => 'TestAppToTestScripts')->run;
-    };
-    ok $TestHelpScript::help;
+    } 'Lives';
+    ok $TestHelpScript::help, 'Got help';
 }
 
 done_testing;