r76791 - in /branches/upstream/libtest-spec-perl/current: Changes META.yml 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:03:27 UTC 2011


Author: ghedo-guest
Date: Thu Jun 30 13:03:25 2011
New Revision: 76791

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=76791
Log:
[svn-upgrade] new version libtest-spec-perl (0.35)

Modified:
    branches/upstream/libtest-spec-perl/current/Changes
    branches/upstream/libtest-spec-perl/current/META.yml
    branches/upstream/libtest-spec-perl/current/lib/Test/Spec.pm
    branches/upstream/libtest-spec-perl/current/t/show_exeptions.t
    branches/upstream/libtest-spec-perl/current/t/test_helper.pl

Modified: branches/upstream/libtest-spec-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-spec-perl/current/Changes?rev=76791&op=diff
==============================================================================
--- branches/upstream/libtest-spec-perl/current/Changes (original)
+++ branches/upstream/libtest-spec-perl/current/Changes Thu Jun 30 13:03:25 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: branches/upstream/libtest-spec-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-spec-perl/current/META.yml?rev=76791&op=diff
==============================================================================
--- branches/upstream/libtest-spec-perl/current/META.yml (original)
+++ branches/upstream/libtest-spec-perl/current/META.yml Thu Jun 30 13:03:25 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: branches/upstream/libtest-spec-perl/current/lib/Test/Spec.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-spec-perl/current/lib/Test/Spec.pm?rev=76791&op=diff
==============================================================================
--- branches/upstream/libtest-spec-perl/current/lib/Test/Spec.pm (original)
+++ branches/upstream/libtest-spec-perl/current/lib/Test/Spec.pm Thu Jun 30 13:03:25 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: branches/upstream/libtest-spec-perl/current/t/show_exeptions.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-spec-perl/current/t/show_exeptions.t?rev=76791&op=diff
==============================================================================
--- branches/upstream/libtest-spec-perl/current/t/show_exeptions.t (original)
+++ branches/upstream/libtest-spec-perl/current/t/show_exeptions.t Thu Jun 30 13:03:25 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: branches/upstream/libtest-spec-perl/current/t/test_helper.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-spec-perl/current/t/test_helper.pl?rev=76791&op=diff
==============================================================================
--- branches/upstream/libtest-spec-perl/current/t/test_helper.pl (original)
+++ branches/upstream/libtest-spec-perl/current/t/test_helper.pl Thu Jun 30 13:03:25 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