[Bps-public-commit] r13889 - in sd/trunk: bin t
jesse at bestpractical.com
jesse at bestpractical.com
Tue Jul 8 16:47:11 EDT 2008
Author: jesse
Date: Tue Jul 8 16:47:10 2008
New Revision: 13889
Added:
sd/trunk/t/00-create.t
sd/trunk/t/help.t
Modified:
sd/trunk/bin/sd
sd/trunk/lib/App/SD.pm
Log:
* testing that we can run the help command
Modified: sd/trunk/bin/sd
==============================================================================
--- sd/trunk/bin/sd (original)
+++ sd/trunk/bin/sd Tue Jul 8 16:47:10 2008
@@ -3,8 +3,8 @@
use strict;
$ENV{'PROPHET_REPO'} = $ENV{'SD_REPO'} || $ENV{'HOME'}.'/.sd';
-
use Prophet::CLI;
+use App::SD;
use App::SD::Model::Ticket;
package App::SD::CLI::Command;
@@ -123,11 +123,13 @@
package App::SD::CLI::Command::Help;
use Moose;
+extends 'Prophet::CLI::Command';
with 'App::SD::CLI::Command';
sub run {
print <<EOF
+$0 @{[$App::SD::VERSION]}
$0 ticket create --summary "This is a summary" --status new --somekey value
$0 ticket update --uuid <uuid> --status resolved
Modified: sd/trunk/lib/App/SD.pm
==============================================================================
--- sd/trunk/lib/App/SD.pm (original)
+++ sd/trunk/lib/App/SD.pm Tue Jul 8 16:47:10 2008
@@ -1,8 +1,7 @@
-use warnings;
-use strict;
-
package App::SD;
+use Moose;
-use base 'Prophet::App';
+extends 'Prophet::App';
+our $VERSION = '0.01';
1;
Added: sd/trunk/t/00-create.t
==============================================================================
--- (empty file)
+++ sd/trunk/t/00-create.t Tue Jul 8 16:47:10 2008
@@ -0,0 +1,26 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use Prophet::Test tests => 2;
+use App::SD::Test;
+use File::Temp qw/tempdir/;
+use Path::Class;
+
+
+no warnings 'once';
+
+BEGIN {
+ require File::Temp;
+ $ENV{'PROPHET_REPO'} = $ENV{'SD_REPO'} = File::Temp::tempdir( CLEANUP => 0 ) . '/_svb';
+ warn "export SD_REPO=".$ENV{'PROPHET_REPO'} ."\n";
+}
+# create from sd and push
+my ($yatta_id, $yatta_uuid) = create_ticket_ok( '--summary', 'YATTA', '--status', 'new' );
+
+run_output_matches( 'sd', [ 'ticket',
+ 'list', '--regex', '.' ],
+ [ qr/(\d+) YATTA new/]
+
+);
+
Added: sd/trunk/t/help.t
==============================================================================
--- (empty file)
+++ sd/trunk/t/help.t Tue Jul 8 16:47:10 2008
@@ -0,0 +1,12 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use Prophet::Test tests => 1;
+use App::SD::Test;
+use App::SD;
+no warnings 'once';
+
+my ($ret,$out,$err) = run_script( 'sd', [ 'help']);
+
+like($out, qr/sd $App::SD::VERSION/sm);
More information about the Bps-public-commit
mailing list