[carton] 96/472: Added unit tests for alias. Fixed test bug not reloading config
Lucas Kanashiro
kanashiro-guest at moszumanska.debian.org
Fri Jul 24 00:38:37 UTC 2015
This is an automated email from the git hooks/post-receive script.
kanashiro-guest pushed a commit to branch master
in repository carton.
commit e49c2692740d310e7ee72d499b72f51a70a65c11
Author: Tatsuhiko Miyagawa <miyagawa at bulknews.net>
Date: Fri Jul 1 15:00:06 2011 -0700
Added unit tests for alias. Fixed test bug not reloading config
---
lib/Carton/CLI.pm | 2 +-
xt/CLI.pm | 1 +
xt/cli/alias.t | 19 +++++++++++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/lib/Carton/CLI.pm b/lib/Carton/CLI.pm
index 8eca724..9eeabf3 100644
--- a/lib/Carton/CLI.pm
+++ b/lib/Carton/CLI.pm
@@ -88,7 +88,7 @@ sub run {
die $_;
}
} else {
- die "Could not find command '$cmd'\n";
+ $self->error("Could not find command '$cmd'\n");
}
}
diff --git a/xt/CLI.pm b/xt/CLI.pm
index fe43a65..aa8d06a 100644
--- a/xt/CLI.pm
+++ b/xt/CLI.pm
@@ -47,6 +47,7 @@ sub print {
sub run {
my($self, @args) = @_;
+ delete $self->{config};
$self->{output} = '';
$self->{system_output} = capture_merged {
eval { $self->SUPER::run(@args) };
diff --git a/xt/cli/alias.t b/xt/cli/alias.t
new file mode 100644
index 0000000..5dbb728
--- /dev/null
+++ b/xt/cli/alias.t
@@ -0,0 +1,19 @@
+use strict;
+use warnings;
+use Test::More;
+use xt::CLI;
+
+{
+ my $app;
+
+ $app = run("foo");
+ like $app->output, qr/Could not find command 'foo'/;
+
+ $app->run("config", "alias.foo", "version");
+
+ $app->run("foo");
+ like $app->output, qr/carton $Carton::VERSION/;
+}
+
+done_testing;
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/carton.git
More information about the Pkg-perl-cvs-commits
mailing list