[carton] 309/472: Added a failing TODO test for downgrading with carton update, then collectin wrong install info

Lucas Kanashiro kanashiro-guest at moszumanska.debian.org
Fri Jul 24 00:38:58 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 b658c1316ea1dfd16d342e35b88ab0a15190c276
Author: Tatsuhiko Miyagawa <miyagawa at bulknews.net>
Date:   Thu Jun 6 09:52:46 2013 +0900

    Added a failing TODO test for downgrading with carton update, then collectin wrong install info
---
 cpanfile        |  2 +-
 xt/cli/update.t | 47 ++++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/cpanfile b/cpanfile
index b8a7ac3..a131bb7 100644
--- a/cpanfile
+++ b/cpanfile
@@ -24,7 +24,7 @@ requires 'CPAN::Meta', 2.120921;
 requires 'CPAN::Meta::Requirements', 2.121;
 
 on develop => sub {
-    requires 'Test::More', 0.88;
+    requires 'Test::More', 0.90;
     requires 'Test::Requires';
     requires 'Capture::Tiny';
     requires 'File::pushd';
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;
 

-- 
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