diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-15 19:21:51 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-15 19:21:51 +0000 |
commit | e31f9059a9f3918f12c40d4d66f2db885d6f914a (patch) | |
tree | e87f850b34f4bafba1f735ed2162a0d7cba5a635 /xt/cli/without.t | |
download | Carton-tarball-master.tar.gz |
Carton-v1.0.21HEADCarton-v1.0.21master
Diffstat (limited to 'xt/cli/without.t')
-rw-r--r-- | xt/cli/without.t | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/xt/cli/without.t b/xt/cli/without.t new file mode 100644 index 0000000..d9c51f7 --- /dev/null +++ b/xt/cli/without.t @@ -0,0 +1,67 @@ +use strict; +use Test::More; +use xt::CLI; + +subtest 'carton install --without develop' => sub { + my $app = cli(); + $app->write_cpanfile(<<EOF); +requires 'Try::Tiny'; + +on 'develop' => sub { + requires 'Hash::MultiValue', '== 0.14'; +}; +EOF + + $app->run("install"); + $app->run("list"); + like $app->stdout, qr/Try-Tiny-/; + like $app->stdout, qr/Hash-MultiValue-0\.14/; + + $app->run("exec", "perl", "-e", "use Hash::MultiValue\ 1"); + like $app->stderr, qr/Hash::MultiValue .* version 0.14/; + + $app->clean_local; + + $app->run("install", "--without", "develop"); + $app->run("list"); + like $app->stdout, qr/Try-Tiny-/; + + TODO: { + local $TODO = "--without is not remembered for list"; + unlike $app->stdout, qr/Hash-MultiValue-/; + } + + $app->run("exec", "perl", "-e", "use Hash::MultiValue\ 1"); + unlike $app->stderr, qr/Hash::MultiValue .* version 0.14/; +}; + +subtest 'without features' => sub { + my $app = cli(); + $app->write_cpanfile(<<EOF); +requires 'Try::Tiny'; + +feature 'stream' => sub { + requires 'Stream::Buffered', '== 0.01'; +}; +EOF + + $app->run("install"); + $app->run("list"); + like $app->stdout, qr/Stream-Buffered-0\.01/; + + $app->clean_local; + + $app->run("install", "--deployment"); + $app->run("exec", "perl", "-e", "use Stream::Buffered 1"); + like $app->stderr, qr/Stream::Buffered .* version 0\.01/; + + $app->clean_local; + + $app->run("install", "--without", "stream"); + + $app->run("exec", "perl", "-e", "use Stream::Buffered 1"); + unlike $app->stderr, qr/Stream::Buffered .* version 0\.01/; +}; + +done_testing; + |