Hello community,
here is the log from the commit of package perl-Test-MockObject for
openSUSE:Factory checked in at 2020-01-24 13:11:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Test-MockObject (Old)
and /work/SRC/openSUSE:Factory/.perl-Test-MockObject.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-MockObject"
Fri Jan 24 13:11:05 2020 rev:8 rq:766609 version:1.20200122
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Test-MockObject/perl-Test-MockObject.changes
2019-10-08 19:57:26.140286370 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Test-MockObject.new.26092/perl-Test-MockObject.changes
2020-01-24 13:12:12.709458342 +0100
@@ -1,0 +2,10 @@
+Thu Jan 23 03:15:03 UTC 2020 - <[email protected]>
+
+- updated to 1.20200122
+ see /usr/share/doc/packages/perl-Test-MockObject/Changes
+
+ 1.20200122 2020-01-22 10:47:03-08:00 America/Los_Angeles
+ - allow mock() to mock multiple methods at once (GH PR #19, Felipe
Gaspar)
+ - tidy up dist metadata (GH PR #18, Mohammad S. Anwar)
+
+-------------------------------------------------------------------
Old:
----
Test-MockObject-1.20191002.tar.gz
New:
----
Test-MockObject-1.20200122.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Test-MockObject.spec ++++++
--- /var/tmp/diff_new_pack.Kffa2d/_old 2020-01-24 13:12:13.537458674 +0100
+++ /var/tmp/diff_new_pack.Kffa2d/_new 2020-01-24 13:12:13.541458675 +0100
@@ -1,7 +1,7 @@
#
# spec file for package perl-Test-MockObject
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 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,7 +17,7 @@
Name: perl-Test-MockObject
-Version: 1.20191002
+Version: 1.20200122
Release: 0
%define cpan_name Test-MockObject
Summary: Perl extension for emulating troublesome interfaces
@@ -54,7 +54,7 @@
%prep
%setup -q -n %{cpan_name}-%{version}
-find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644
+find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path
"*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644
%build
perl Makefile.PL INSTALLDIRS=vendor
++++++ Test-MockObject-1.20191002.tar.gz -> Test-MockObject-1.20200122.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockObject-1.20191002/Changes
new/Test-MockObject-1.20200122/Changes
--- old/Test-MockObject-1.20191002/Changes 2019-10-02 18:32:56.000000000
+0200
+++ new/Test-MockObject-1.20200122/Changes 2020-01-22 19:47:05.000000000
+0100
@@ -1,5 +1,9 @@
Revision history for Perl extension Test::MockObject.
+1.20200122 2020-01-22 10:47:03-08:00 America/Los_Angeles
+ - allow mock() to mock multiple methods at once (GH PR #19, Felipe Gaspar)
+ - tidy up dist metadata (GH PR #18, Mohammad S. Anwar)
+
1.20191002 2019-10-02 09:32:54-07:00 America/Los_Angeles
- replace non-core CGI dependency with core CPAN dependency
(Yanick Champoux, GH PR #16)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockObject-1.20191002/MANIFEST
new/Test-MockObject-1.20200122/MANIFEST
--- old/Test-MockObject-1.20191002/MANIFEST 2019-10-02 18:32:56.000000000
+0200
+++ new/Test-MockObject-1.20200122/MANIFEST 2020-01-22 19:47:05.000000000
+0100
@@ -2,6 +2,7 @@
Changes
LICENSE
MANIFEST
+META.json
META.yml
Makefile.PL
README
@@ -18,4 +19,5 @@
t/extends.t
t/ignore.t
t/isa.t
+t/multimock.t
t/nodefaultwarnings.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockObject-1.20191002/META.json
new/Test-MockObject-1.20200122/META.json
--- old/Test-MockObject-1.20191002/META.json 1970-01-01 01:00:00.000000000
+0100
+++ new/Test-MockObject-1.20200122/META.json 2020-01-22 19:47:05.000000000
+0100
@@ -0,0 +1,64 @@
+{
+ "abstract" : "Perl extension for emulating troublesome interfaces",
+ "author" : [
+ "chromatic"
+ ],
+ "dynamic_config" : 0,
+ "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version
2.150010",
+ "license" : [
+ "perl_5"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : 2
+ },
+ "name" : "Test-MockObject",
+ "prereqs" : {
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "Carp" : "0",
+ "Devel::Peek" : "0",
+ "Scalar::Util" : "0",
+ "Test::Builder" : "0",
+ "UNIVERSAL::can" : "1.20110617",
+ "UNIVERSAL::isa" : "1.20110614",
+ "constant" : "0",
+ "perl" : "5.008",
+ "strict" : "0",
+ "warnings" : "0"
+ }
+ },
+ "test" : {
+ "requires" : {
+ "Test::Exception" : "0.31",
+ "Test::More" : "0.98",
+ "Test::Warn" : "0.23",
+ "base" : "0",
+ "fields" : "0",
+ "overload" : "0",
+ "vars" : "0"
+ }
+ }
+ },
+ "release_status" : "stable",
+ "resources" : {
+ "bugtracker" : {
+ "mailto" : "[email protected]",
+ "web" : "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-MockObject"
+ },
+ "repository" : {
+ "type" : "git",
+ "url" : "https://github.com/chromatic/Test-MockObject.git",
+ "web" : "https://github.com/chromatic/Test-MockObject"
+ }
+ },
+ "version" : "1.20200122",
+ "x_generated_by_perl" : "v5.30.0",
+ "x_serialization_backend" : "Cpanel::JSON::XS version 4.11"
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockObject-1.20191002/META.yml
new/Test-MockObject-1.20200122/META.yml
--- old/Test-MockObject-1.20191002/META.yml 2019-10-02 18:32:56.000000000
+0200
+++ new/Test-MockObject-1.20200122/META.yml 2020-01-22 19:47:05.000000000
+0100
@@ -27,11 +27,12 @@
UNIVERSAL::can: '1.20110617'
UNIVERSAL::isa: '1.20110614'
constant: '0'
+ perl: '5.008'
strict: '0'
warnings: '0'
resources:
bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-MockObject
repository: https://github.com/chromatic/Test-MockObject.git
-version: '1.20191002'
+version: '1.20200122'
x_generated_by_perl: v5.30.0
x_serialization_backend: 'YAML::Tiny version 1.73'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockObject-1.20191002/Makefile.PL
new/Test-MockObject-1.20200122/Makefile.PL
--- old/Test-MockObject-1.20191002/Makefile.PL 2019-10-02 18:32:56.000000000
+0200
+++ new/Test-MockObject-1.20200122/Makefile.PL 2020-01-22 19:47:05.000000000
+0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
-
+use 5.008;
use ExtUtils::MakeMaker;
@@ -14,6 +14,7 @@
},
"DISTNAME" => "Test-MockObject",
"LICENSE" => "perl",
+ "MIN_PERL_VERSION" => "5.008",
"NAME" => "Test::MockObject",
"PREREQ_PM" => {
"Carp" => 0,
@@ -35,7 +36,7 @@
"overload" => 0,
"vars" => 0
},
- "VERSION" => "1.20191002",
+ "VERSION" => "1.20200122",
"test" => {
"TESTS" => "t/*.t"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockObject-1.20191002/README
new/Test-MockObject-1.20200122/README
--- old/Test-MockObject-1.20191002/README 2019-10-02 18:32:56.000000000
+0200
+++ new/Test-MockObject-1.20200122/README 2020-01-22 19:47:05.000000000
+0100
@@ -1,5 +1,5 @@
This archive contains the distribution Test-MockObject,
-version 1.20191002:
+version 1.20200122:
Perl extension for emulating troublesome interfaces
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockObject-1.20191002/dist.ini
new/Test-MockObject-1.20200122/dist.ini
--- old/Test-MockObject-1.20191002/dist.ini 2019-10-02 18:32:56.000000000
+0200
+++ new/Test-MockObject-1.20200122/dist.ini 2020-01-22 19:47:05.000000000
+0100
@@ -29,6 +29,8 @@
[@Basic]
[PkgVersion]
[NextRelease]
+[MetaJSON]
+[MinimumPerlFast]
[@Git]
changelog = Changes ; this is the default
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Test-MockObject-1.20191002/lib/Test/MockObject/Extends.pm
new/Test-MockObject-1.20200122/lib/Test/MockObject/Extends.pm
--- old/Test-MockObject-1.20191002/lib/Test/MockObject/Extends.pm
2019-10-02 18:32:56.000000000 +0200
+++ new/Test-MockObject-1.20200122/lib/Test/MockObject/Extends.pm
2020-01-22 19:47:05.000000000 +0100
@@ -1,5 +1,5 @@
package Test::MockObject::Extends;
-$Test::MockObject::Extends::VERSION = '1.20191002';
+$Test::MockObject::Extends::VERSION = '1.20200122';
use strict;
use warnings;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockObject-1.20191002/lib/Test/MockObject.pm
new/Test-MockObject-1.20200122/lib/Test/MockObject.pm
--- old/Test-MockObject-1.20191002/lib/Test/MockObject.pm 2019-10-02
18:32:56.000000000 +0200
+++ new/Test-MockObject-1.20200122/lib/Test/MockObject.pm 2020-01-22
19:47:05.000000000 +0100
@@ -1,5 +1,5 @@
package Test::MockObject;
-$Test::MockObject::VERSION = '1.20191002';
+$Test::MockObject::VERSION = '1.20200122';
use strict;
use warnings;
@@ -33,12 +33,15 @@
sub mock
{
- my ($self, $name, $sub) = @_;
- $sub ||= sub {};
+ my ($self, @names_and_subs) = @_;
- # leading dash means unlog, otherwise do log
- _set_log( $self, $name, ( $name =~ s/^-// ? 0 : 1 ) );
- _subs( $self )->{$name} = $sub;
+ while ( my ($name, $sub) = splice @names_and_subs, 0, 2 ) {
+ $sub ||= sub {};
+
+ # leading dash means unlog, otherwise do log
+ _set_log( $self, $name, ( $name =~ s/^-// ? 0 : 1 ) );
+ _subs( $self )->{$name} = $sub;
+ }
$self;
}
@@ -545,10 +548,10 @@
=over 4
-=item * C<mock(I<name>, I<coderef>)>
+=item * C<mock(I<name>, I<coderef> [, I<name2>, I<coderef2>, ...])>
-Adds a coderef to the object. This allows code to call the named method on the
-object. For example, this code:
+Adds one or more coderefs to the object. This allows code to call the named
+methods on the object. For example, this code:
my $mock = Test::MockObject->new();
$mock->mock( 'fluorinate',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockObject-1.20191002/t/multimock.t
new/Test-MockObject-1.20200122/t/multimock.t
--- old/Test-MockObject-1.20191002/t/multimock.t 1970-01-01
01:00:00.000000000 +0100
+++ new/Test-MockObject-1.20200122/t/multimock.t 2020-01-22
19:47:05.000000000 +0100
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $package = 'Test::MockObject';
+use Test::More tests => 3;
+use_ok( $package );
+
+my $mock = Test::MockObject->new();
+
+$mock->mock(
+ foo => sub { 'foo' },
+ bar => sub { 'bar' },
+);
+
+is( $mock->foo(), 'foo', 'mock one in multi-mock' );
+is( $mock->bar(), 'bar', 'mock two in multi-mock' );