r76795 - in /trunk/libtest-spec-perl: Changes META.yml debian/changelog lib/Test/Spec.pm t/show_exeptions.t t/test_helper.pl

ghedo-guest at users.alioth.debian.org ghedo-guest at users.alioth.debian.org
Thu Jun 30 13:05:08 UTC 2011


Author: ghedo-guest
Date: Thu Jun 30 13:04:58 2011
New Revision: 76795

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=76795
Log:
IGNORE-VERSION: 0.35-1
Fix tests for Windows
* New upstream release

Modified:
    trunk/libtest-spec-perl/Changes
    trunk/libtest-spec-perl/META.yml
    trunk/libtest-spec-perl/debian/changelog
    trunk/libtest-spec-perl/lib/Test/Spec.pm
    trunk/libtest-spec-perl/t/show_exeptions.t
    trunk/libtest-spec-perl/t/test_helper.pl

Modified: trunk/libtest-spec-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-spec-perl/Changes?rev=76795&op=diff
==============================================================================
--- trunk/libtest-spec-perl/Changes (original)
+++ trunk/libtest-spec-perl/Changes Thu Jun 30 13:04:58 2011
@@ -1,4 +1,11 @@
 Revision history for Perl extension Test::Spec.
+
+0.35 Wed Jun 29 16:52:00 UTC 2011
+  - Fixed test suite for Windows environments.
+
+0.34
+  - Added spec_helper utility function to load helper scripts
+    relative to the spec.
 
 0.33 Mon Jun 13 15:03:03 UTC 2011
   - Added shared_examples_for/it_should_behave_like to allow

Modified: trunk/libtest-spec-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-spec-perl/META.yml?rev=76795&op=diff
==============================================================================
--- trunk/libtest-spec-perl/META.yml (original)
+++ trunk/libtest-spec-perl/META.yml Thu Jun 30 13:04:58 2011
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Test-Spec
-version:            0.34
+version:            0.35
 abstract:           Write tests in a declarative specification style
 author:
     - Philip Garrett <philip.garrett at icainformatics.com>

Modified: trunk/libtest-spec-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-spec-perl/debian/changelog?rev=76795&op=diff
==============================================================================
--- trunk/libtest-spec-perl/debian/changelog (original)
+++ trunk/libtest-spec-perl/debian/changelog Thu Jun 30 13:04:58 2011
@@ -1,3 +1,12 @@
+libtest-spec-perl (0.35-1) UNRELEASED; urgency=low
+
+  IGNORE-VERSION: 0.35-1
+  Fix tests for Windows
+
+  * New upstream release
+
+ -- Alessandro Ghedini <al3xbio at gmail.com>  Thu, 30 Jun 2011 15:03:52 +0200
+
 libtest-spec-perl (0.34-1) unstable; urgency=low
 
   * Team upload.

Modified: trunk/libtest-spec-perl/lib/Test/Spec.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-spec-perl/lib/Test/Spec.pm?rev=76795&op=diff
==============================================================================
--- trunk/libtest-spec-perl/lib/Test/Spec.pm (original)
+++ trunk/libtest-spec-perl/lib/Test/Spec.pm Thu Jun 30 13:04:58 2011
@@ -3,7 +3,7 @@
 use warnings;
 use Test::Trap ();        # load as early as possible to override CORE::exit
 
-our $VERSION = '0.34';
+our $VERSION = '0.35';
 
 use base qw(Exporter);
 

Modified: trunk/libtest-spec-perl/t/show_exeptions.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-spec-perl/t/show_exeptions.t?rev=76795&op=diff
==============================================================================
--- trunk/libtest-spec-perl/t/show_exeptions.t (original)
+++ trunk/libtest-spec-perl/t/show_exeptions.t Thu Jun 30 13:04:58 2011
@@ -13,14 +13,14 @@
 describe "Test::Spec" => sub {
   my $tap = capture_tap("dying_spec.pl");
 
-  it "should display the error message for uncaught exceptions" => sub {
-    my @patterns = (
-      qr/^#   Failed test 'Test::Spec should trap die message' by dying:\n/m,
-      qr/^#     this should be displayed\n/m,
-      qr/^#     at .+? line \d+\.\n/m,
-    );
-    local $" = "";
-    like($tap, qr/@patterns/);
+  it "should explain why a dying test failed" => sub {
+    like($tap, qr/^#   Failed test 'Test::Spec should trap die message' by dying:\s*$/m);
+  };
+  it "should echo the exception message" => sub {
+    like($tap, qr/^#     this should be displayed\s*$/m);
+  };
+  it "should report the context at which the error occurred" => sub {
+    like($tap, qr/^#     at .+? line \d+\.\s*$/m);
   };
   it "should continue running tests after an exception is encountered" => sub {
     like($tap, qr/^ok \d+ - Test::Spec should continue testing/m);

Modified: trunk/libtest-spec-perl/t/test_helper.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-spec-perl/t/test_helper.pl?rev=76795&op=diff
==============================================================================
--- trunk/libtest-spec-perl/t/test_helper.pl (original)
+++ trunk/libtest-spec-perl/t/test_helper.pl Thu Jun 30 13:04:58 2011
@@ -21,15 +21,20 @@
 }
 
 sub capture_tap {
+  my ($spec_name) = @_;
+
   require File::Spec;
-  my ($spec_name) = @_;
-  my @incflags = map { "-I$_" } @INC;
-  open(my $SPEC, '-|') || do {
-    open(STDERR, ">&STDOUT") || die "can't reopen stderr: $!";  # 2>&1
-    exec($^X, @incflags, File::Spec->catfile($Bin, $spec_name));
+  require File::Temp;
+  my ($fh,$filename) = File::Temp::tempfile('tmpfileXXXXXX', UNLINK => 1, TMPDIR => 1);
+  my $pid = fork || do {
+    STDOUT->fdopen(fileno($fh), "w") || die "can't reopen stdout: $!";
+    STDERR->fdopen(fileno($fh), "w") || die "can't reopen stderr: $!";
+    exec($^X, (map { "-I$_" } @INC), File::Spec->catfile($Bin, $spec_name));
+    die "couldn't exec '$spec_name'";
   };
-  my $tap = do { local $/; <$SPEC> };
-  close($SPEC);
+  waitpid($pid,0);
+  seek($fh, 0, 0);
+  my $tap = do { local $/; <$fh> };
   return $tap;
 }
 




More information about the Pkg-perl-cvs-commits mailing list