Hello community,
here is the log from the commit of package perl-Test-Spec for openSUSE:Factory checked in at 2017-09-04 12:36:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Test-Spec (Old)
and /work/SRC/openSUSE:Factory/.perl-Test-Spec.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-Spec"
Mon Sep 4 12:36:39 2017 rev:13 rq:520424 version:0.52
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Test-Spec/perl-Test-Spec.changes 2015-08-02 22:46:18.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.perl-Test-Spec.new/perl-Test-Spec.changes 2017-09-04 12:36:39.900620668 +0200
@@ -1,0 +2,14 @@
+Wed Aug 16 06:18:21 UTC 2017 - coolo@suse.com
+
+- updated to 0.52
+ see /usr/share/doc/packages/perl-Test-Spec/Changes
+
+ 0.52 Tue Aug 15 10:20:00 BST 2017
+ - Pass example instance to each test
+ Contributed by @jamhed (issue #30, #41)
+ - Fix runtests to run all examples that match any of the patterns
+ Contributed by @mpw96 (issue #37, #38)
+ - Ensure META.json includes requirements
+ Reported by @joelrebel (issue #39)
+
+-------------------------------------------------------------------
Old:
----
Test-Spec-0.51.tar.gz
New:
----
Test-Spec-0.52.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Test-Spec.spec ++++++
--- /var/tmp/diff_new_pack.8esxnb/_old 2017-09-04 12:36:41.196438358 +0200
+++ /var/tmp/diff_new_pack.8esxnb/_new 2017-09-04 12:36:41.204437233 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Test-Spec
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,14 +17,14 @@
Name: perl-Test-Spec
-Version: 0.51
+Version: 0.52
Release: 0
%define cpan_name Test-Spec
Summary: Write tests in a declarative specification style
License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Test-Spec/
-Source0: http://www.cpan.org/authors/id/A/AN/ANDYJONES/%{cpan_name}-%{version}.tar.gz
+Source0: https://cpan.metacpan.org/authors/id/A/AN/ANDYJONES/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -57,7 +57,7 @@
%prep
%setup -q -n %{cpan_name}-%{version}
-find . -type f -print0 | xargs -0 chmod 644
+find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
++++++ Test-Spec-0.51.tar.gz -> Test-Spec-0.52.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Spec-0.51/Changes new/Test-Spec-0.52/Changes
--- old/Test-Spec-0.51/Changes 2015-07-27 21:07:38.000000000 +0200
+++ new/Test-Spec-0.52/Changes 2017-08-15 11:51:50.000000000 +0200
@@ -1,5 +1,13 @@
Revision history for Perl extension Test::Spec.
+0.52 Tue Aug 15 10:20:00 BST 2017
+ - Pass example instance to each test
+ Contributed by @jamhed (issue #30, #41)
+ - Fix runtests to run all examples that match any of the patterns
+ Contributed by @mpw96 (issue #37, #38)
+ - Ensure META.json includes requirements
+ Reported by @joelrebel (issue #39)
+
0.51 Mon Jul 27 20:05:00 BST 2015
- Fixed top level describe blocks running out of order
Contributed by @mla (issue #28)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Spec-0.51/MANIFEST new/Test-Spec-0.52/MANIFEST
--- old/Test-Spec-0.51/MANIFEST 2015-07-27 21:14:00.000000000 +0200
+++ new/Test-Spec-0.52/MANIFEST 2017-08-15 11:54:25.000000000 +0200
@@ -17,9 +17,12 @@
t/disabled_spec.pl
t/dying_spec.pl
t/empty.t
+t/example_in_handler.t
t/helper_test.pl
t/import_strict.t
t/import_warnings.t
+t/manifest.t
+t/meta.t
t/mocks.t
t/mocks_imports.t
t/ordering.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Spec-0.51/META.json new/Test-Spec-0.52/META.json
--- old/Test-Spec-0.51/META.json 2015-07-27 21:14:00.000000000 +0200
+++ new/Test-Spec-0.52/META.json 2017-08-15 11:54:25.000000000 +0200
@@ -4,13 +4,13 @@
"Philip Garrett "
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 6.6302, CPAN::Meta::Converter version 2.120630",
+ "generated_by" : "ExtUtils::MakeMaker version 7.3, CPAN::Meta::Converter version 2.150010",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
- "version" : "2"
+ "version" : 2
},
"name" : "Test-Spec",
"no_index" : {
@@ -19,6 +19,33 @@
"inc"
]
},
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "Carp" : "0",
+ "Exporter" : "0",
+ "List::Util" : "0",
+ "Package::Stash" : "0.23",
+ "Scalar::Util" : "1.11",
+ "TAP::Parser" : "0",
+ "Test::Deep" : "0.103",
+ "Test::More" : "0.88",
+ "Test::Trap" : "0",
+ "Tie::IxHash" : "0",
+ "constant" : "0"
+ }
+ }
+ },
"release_status" : "stable",
"resources" : {
"bugtracker" : {
@@ -30,5 +57,6 @@
"web" : "https://github.com/kingpong/perl-Test-Spec"
}
},
- "version" : "0.51"
+ "version" : "0.52",
+ "x_serialization_backend" : "JSON::PP version 2.94"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Spec-0.51/META.yml new/Test-Spec-0.52/META.yml
--- old/Test-Spec-0.51/META.yml 2015-07-27 21:14:00.000000000 +0200
+++ new/Test-Spec-0.52/META.yml 2017-08-15 11:54:25.000000000 +0200
@@ -2,19 +2,35 @@
abstract: 'Write tests in a declarative specification style'
author:
- 'Philip Garrett '
-build_requires: {}
+build_requires:
+ ExtUtils::MakeMaker: '0'
+configure_requires:
+ ExtUtils::MakeMaker: '0'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.6302, CPAN::Meta::Converter version 2.120630'
+generated_by: 'ExtUtils::MakeMaker version 7.3, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ version: '1.4'
name: Test-Spec
no_index:
directory:
- t
- inc
+requires:
+ Carp: '0'
+ Exporter: '0'
+ List::Util: '0'
+ Package::Stash: '0.23'
+ Scalar::Util: '1.11'
+ TAP::Parser: '0'
+ Test::Deep: '0.103'
+ Test::More: '0.88'
+ Test::Trap: '0'
+ Tie::IxHash: '0'
+ constant: '0'
resources:
bugtracker: https://github.com/kingpong/perl-Test-Spec/issues
repository: https://github.com/kingpong/perl-Test-Spec
-version: 0.51
+version: '0.52'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.011'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Spec-0.51/lib/Test/Spec/Context.pm new/Test-Spec-0.52/lib/Test/Spec/Context.pm
--- old/Test-Spec-0.51/lib/Test/Spec/Context.pm 2015-04-19 19:10:20.000000000 +0200
+++ new/Test-Spec-0.52/lib/Test/Spec/Context.pm 2017-08-15 11:40:37.000000000 +0200
@@ -375,18 +375,18 @@
# for giving individual tests mortal, anonymous contexts that are used for
# mocking/stubbing hooks.
sub _in_anonymous_context {
- my ($self,$code) = @_;
+ my ($self,$code,$example) = @_;
my $context = Test::Spec::Context->new;
$context->name('');
$context->parent($self);
$context->class($self->class);
- $context->contextualize($code);
+ $context->contextualize($code, $example);
}
# Runs $code within a context (specifically, having been wrapped with
# on_enter/on_leave setup and teardown).
sub contextualize {
- my ($self,$code) = @_;
+ my ($self,$code,$example) = @_;
local $Test::Spec::_Current_Context = $self;
local $self->{_has_run_on_enter} = {};
local $self->{_has_run_on_leave} = {};
@@ -397,7 +397,7 @@
push @errs, $@ if $@;
if (not @errs) {
- eval { $code->() };
+ eval { $code->($example) };
push @errs, $@ if $@;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Spec-0.51/lib/Test/Spec/Example.pm new/Test-Spec-0.52/lib/Test/Spec/Example.pm
--- old/Test-Spec-0.51/lib/Test/Spec/Example.pm 2015-04-19 19:10:20.000000000 +0200
+++ new/Test-Spec-0.52/lib/Test/Spec/Example.pm 2017-08-15 11:40:37.000000000 +0200
@@ -131,7 +131,7 @@
$self->_runner(@remainder);
}
else {
- $ctx->_in_anonymous_context($self->code);
+ $ctx->_in_anonymous_context($self->code, $self);
}
$ctx->_run_after('each');
# "after 'all'" only happens during context destruction (DEMOLISH).
@@ -139,7 +139,7 @@
# in the case that only specific test methods are run.
# Otherwise, the global teardown would only happen when you
# happen to run the last test of the context.
- });
+ }, $self);
}
1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Spec-0.51/lib/Test/Spec.pm new/Test-Spec-0.52/lib/Test/Spec.pm
--- old/Test-Spec-0.51/lib/Test/Spec.pm 2015-07-27 21:07:47.000000000 +0200
+++ new/Test-Spec-0.52/lib/Test/Spec.pm 2017-08-15 11:51:56.000000000 +0200
@@ -3,7 +3,7 @@
use warnings;
use Test::Trap (); # load as early as possible to override CORE::exit
-our $VERSION = '0.51';
+our $VERSION = '0.52';
use base qw(Exporter);
@@ -142,9 +142,10 @@
sub _pick_tests {
my ($class,@matchers) = @_;
my @tests = $class->tests;
- for my $pattern (@matchers) {
- @tests = grep { $_->name =~ /$pattern/i } @tests;
- }
+
+ my $pattern = join("|", @matchers);
+ @tests = grep { $_->name =~ /$pattern/i } @tests;
+
return @tests;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Spec-0.51/t/example_in_handler.t new/Test-Spec-0.52/t/example_in_handler.t
--- old/Test-Spec-0.51/t/example_in_handler.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Test-Spec-0.52/t/example_in_handler.t 2017-08-15 11:40:37.000000000 +0200
@@ -0,0 +1,13 @@
+#!/usr/bin/env perl
+package Testcase::Spec::ExampleInHandler;
+use Test::Spec;
+
+describe "Test::Spec" => sub {
+ it "should pass an example instance" => sub {
+ my ($example) = @_;
+ ok($example);
+ isa_ok($example, 'Test::Spec::Example');
+ };
+};
+
+runtests unless caller;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Spec-0.51/t/manifest.t new/Test-Spec-0.52/t/manifest.t
--- old/Test-Spec-0.51/t/manifest.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Test-Spec-0.52/t/manifest.t 2017-08-15 11:46:21.000000000 +0200
@@ -0,0 +1,11 @@
+use strict;
+use warnings;
+use Test::More;
+
+unless ($ENV{RELEASE_TESTING}) {
+ plan skip_all => "Author tests not required for installation";
+}
+
+eval "use Test::CheckManifest 0.9";
+plan skip_all => "Test::CheckManifest 0.9 required" if $@;
+ok_manifest();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Spec-0.51/t/meta.t new/Test-Spec-0.52/t/meta.t
--- old/Test-Spec-0.51/t/meta.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Test-Spec-0.52/t/meta.t 2017-08-15 11:46:21.000000000 +0200
@@ -0,0 +1,35 @@
+use strict;
+use warnings;
+
+unless ($ENV{RELEASE_TESTING}) {
+ plan(skip_all => "Author tests not required for installation");
+}
+
+eval "use CPAN::Meta";
+plan(skip_all => "CPAN::Meta required for testing MYMETA.json") if $@;
+my $mymeta = CPAN::Meta->load_file('MYMETA.json');
+
+use Test::More;
+my (@requirements) = required_modules($mymeta);
+ok scalar(@requirements);
+done_testing();
+
+sub required_modules {
+ my $prereqs = $mymeta->effective_prereqs;
+ my $requires = $prereqs->merged_requirements;
+ return $requires->required_modules;
+}
+
+__END__
+use Test::Spec;
+describe 'MYMETA.json' => sub {
+ it 'lists prereqs' => sub {
+ my $mymeta = CPAN::Meta->load_file('MYMETA.json');
+ print STDERR Dumper($mymeta->effective_prereqs);
+
+
+
+ };
+};
+
+run_tests();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Spec-0.51/t/runtests_subset.t new/Test-Spec-0.52/t/runtests_subset.t
--- old/Test-Spec-0.51/t/runtests_subset.t 2015-03-15 21:40:31.000000000 +0100
+++ new/Test-Spec-0.52/t/runtests_subset.t 2017-08-15 11:40:37.000000000 +0200
@@ -36,6 +36,20 @@
};
};
+ describe "when more than one specific example is requested explicitly" => sub {
+ my $tap;
+ before all => sub {
+ # case insensitivity is baked in
+ $tap = capture_tap("subset_spec.pl", "oNe", "Two");
+ };
+ it "should run the requested examples" => sub {
+ like $tap, qr/^ok \d+ - Test One.*ok \d+ - Test Two/ms;
+ };
+ it "should run ONLY the requested examples" => sub {
+ unlike $tap, qr/^ok \d+ - Test Three/;
+ };
+ };
+
describe "when specific examples are requested via SPEC environment var" => sub {
my $tap;
before all => sub {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Spec-0.51/t/subset_spec.pl new/Test-Spec-0.52/t/subset_spec.pl
--- old/Test-Spec-0.51/t/subset_spec.pl 2015-03-15 21:40:31.000000000 +0100
+++ new/Test-Spec-0.52/t/subset_spec.pl 2017-08-15 11:40:37.000000000 +0200
@@ -14,6 +14,7 @@
describe "Test" => sub {
it "One" => sub { pass };
it "Two" => sub { pass };
+ it "Three" => sub { pass };
};
runtests(@ARGV) unless caller;