diff options
author | Tatsuhiko Miyagawa <miyagawa@bulknews.net> | 2013-06-06 09:52:46 +0900 |
---|---|---|
committer | Tatsuhiko Miyagawa <miyagawa@bulknews.net> | 2013-06-06 09:52:46 +0900 |
commit | b658c1316ea1dfd16d342e35b88ab0a15190c276 (patch) | |
tree | c8d8783e5f2cf6fffd438f34f7c42f1ff29705f9 /xt | |
parent | a97c7f550e2da78810b84ed13922fed9898b9688 (diff) | |
download | carton-b658c1316ea1dfd16d342e35b88ab0a15190c276.tar.gz |
Added a failing TODO test for downgrading with carton update, then collectin wrong install info
Diffstat (limited to 'xt')
-rw-r--r-- | xt/cli/update.t | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/xt/cli/update.t b/xt/cli/update.t index 60617d9..8babb1d 100644 --- a/xt/cli/update.t +++ b/xt/cli/update.t @@ -2,7 +2,19 @@ use strict; use Test::More; use xt::CLI; -{ +subtest 'carton update NonExistentModule' => sub { + my $app = cli(); + + $app->dir->child("cpanfile")->spew(<<EOF); +requires 'Try::Tiny', '== 0.09'; +EOF + + $app->run("install"); + $app->run("update", "XYZ"); + like $app->stderr, qr/Could not find module XYZ/; +}; + +subtest 'carton update upgrades a dist' => sub { my $app = cli(); $app->dir->child("cpanfile")->spew(<<EOF); @@ -24,9 +36,6 @@ EOF $app->run("list"); like $app->stdout, qr/Try-Tiny-0\.09/; - $app->run("update", "XYZ"); - like $app->stderr, qr/Could not find module XYZ/; - $app->run("update", "Try::Tiny"); like $app->stderr, qr/installed Try-Tiny-0\.12.*upgraded from 0\.09/; @@ -35,7 +44,35 @@ EOF $app->run("list"); like $app->stdout, qr/Try-Tiny-0\.12/; -} +}; + +subtest 'downgrade a distribution' => sub { + my $app = cli(); + + $app->dir->child("cpanfile")->spew(<<EOF); +requires 'Try::Tiny', '0.12'; +EOF + $app->run("install"); + $app->run("list"); + like $app->stdout, qr/Try-Tiny-0\.12/; + + $app->dir->child("cpanfile")->spew(<<EOF); +requires 'Try::Tiny', '== 0.09'; +EOF + $app->run("update"); + $app->run("list"); + like $app->stdout, qr/Try-Tiny-0\.09/; + + TODO: { + local $TODO = 'collecting wrong install info'; + $app->dir->child("cpanfile")->spew(<<EOF); +requires 'Try::Tiny', '0.09'; +EOF + $app->run("install"); + $app->run("list"); + like $app->stdout, qr/Try-Tiny-0\.09/; + } +}; done_testing; |