Hello community,
here is the log from the commit of package perl-Test-MockModule for
openSUSE:Factory checked in at 2017-07-21 22:37:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Test-MockModule (Old)
and /work/SRC/openSUSE:Factory/.perl-Test-MockModule.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-MockModule"
Fri Jul 21 22:37:29 2017 rev:5 rq:510428 version:0.12
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Test-MockModule/perl-Test-MockModule.changes
2015-10-30 13:43:33.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Test-MockModule.new/perl-Test-MockModule.changes
2017-07-21 22:37:33.109002664 +0200
@@ -1,0 +2,13 @@
+Thu Jul 13 06:14:05 UTC 2017 - [email protected]
+
+- updated to 0.12
+ see /usr/share/doc/packages/perl-Test-MockModule/Changes
+
+ v0.12
+ - Added the `noop()` function to make mocking noops easier. Thanks for
the PR,
+ Ali Zia!
+
+ v0.11 2016-10-27
+ - Various housekeeping, testing and minor fixes, courtesy of Paul
Cochrane, thanks!
+
+-------------------------------------------------------------------
Old:
----
Test-MockModule-0.11.tar.gz
New:
----
Test-MockModule-0.12.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Test-MockModule.spec ++++++
--- /var/tmp/diff_new_pack.pYxjpC/_old 2017-07-21 22:37:34.616789969 +0200
+++ /var/tmp/diff_new_pack.pYxjpC/_new 2017-07-21 22:37:34.620789405 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Test-MockModule
#
-# 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,7 +17,7 @@
Name: perl-Test-MockModule
-Version: 0.11
+Version: 0.12
Release: 0
#Upstream: GPL-1.0+
%define cpan_name Test-MockModule
@@ -25,7 +25,7 @@
License: GPL-3.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Test-MockModule/
-Source0:
http://www.cpan.org/authors/id/G/GF/GFRANKS/%{cpan_name}-%{version}.tar.gz
+Source0:
https://cpan.metacpan.org/authors/id/G/GF/GFRANKS/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -33,6 +33,7 @@
BuildRequires: perl-macros
BuildRequires: perl(Module::Build) >= 0.380000
BuildRequires: perl(SUPER)
+BuildRequires: perl(Test::More) >= 0.88
Requires: perl(SUPER)
%{perl_requires}
@@ -61,6 +62,7 @@
%files -f %{name}.files
%defattr(-,root,root,755)
-%doc Changes LICENSE README.md
+%doc Changes README.md
+%license LICENSE
%changelog
++++++ Test-MockModule-0.11.tar.gz -> Test-MockModule-0.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockModule-0.11/Build.PL
new/Test-MockModule-0.12/Build.PL
--- old/Test-MockModule-0.11/Build.PL 2015-10-28 02:29:14.000000000 +0100
+++ new/Test-MockModule-0.12/Build.PL 2017-07-12 22:04:37.000000000 +0200
@@ -26,7 +26,7 @@
'SUPER' => 0,
},
build_requires => {
- 'Test::More' => 0.45,
+ 'Test::More' => 0.88,
},
add_to_cleanup => [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockModule-0.11/Changes
new/Test-MockModule-0.12/Changes
--- old/Test-MockModule-0.11/Changes 2015-10-28 02:29:14.000000000 +0100
+++ new/Test-MockModule-0.12/Changes 2017-07-12 22:04:37.000000000 +0200
@@ -1,5 +1,12 @@
Revision history for Test::MockModule
+v0.12
+ - Added the `noop()` function to make mocking noops easier. Thanks for the
PR,
+ Ali Zia!
+
+v0.11 2016-10-27
+ - Various housekeeping, testing and minor fixes, courtesy of Paul
Cochrane, thanks!
+
v0.10 2015-05-30
- Updated docs for mocking when using exported functions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockModule-0.11/LICENSE
new/Test-MockModule-0.12/LICENSE
--- old/Test-MockModule-0.11/LICENSE 2015-10-28 02:29:14.000000000 +0100
+++ new/Test-MockModule-0.12/LICENSE 2017-07-12 22:04:37.000000000 +0200
@@ -1,4 +1,4 @@
-This software is Copyright (c) 2015 by Current Maintainer: Geoff Franks
<[email protected]> & Original Author: Simon Flack <simonflk _AT_ cpan.org>.
+This software is Copyright (c) 2017 by Current Maintainer: Geoff Franks
<[email protected]> & Original Author: Simon Flack <simonflk _AT_ cpan.org>.
This is free software, licensed under:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockModule-0.11/META.json
new/Test-MockModule-0.12/META.json
--- old/Test-MockModule-0.11/META.json 2015-10-28 02:29:14.000000000 +0100
+++ new/Test-MockModule-0.12/META.json 2017-07-12 22:04:37.000000000 +0200
@@ -17,7 +17,7 @@
"prereqs" : {
"build" : {
"requires" : {
- "Test::More" : "0.45"
+ "Test::More" : "0.88"
}
},
"configure" : {
@@ -37,7 +37,7 @@
"provides" : {
"Test::MockModule" : {
"file" : "lib/Test/MockModule.pm",
- "version" : "0.11"
+ "version" : "0.12"
}
},
"release_status" : "stable",
@@ -53,6 +53,6 @@
"url" : "git://github.com/geofffranks/test-mockmodule.git"
}
},
- "version" : "0.11",
- "x_serialization_backend" : "JSON::PP version 2.27203"
+ "version" : "0.12",
+ "x_serialization_backend" : "JSON::PP version 2.27400"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockModule-0.11/META.yml
new/Test-MockModule-0.12/META.yml
--- old/Test-MockModule-0.11/META.yml 2015-10-28 02:29:14.000000000 +0100
+++ new/Test-MockModule-0.12/META.yml 2017-07-12 22:04:37.000000000 +0200
@@ -4,7 +4,7 @@
- 'Current Maintainer: Geoff Franks <[email protected]>'
- 'Original Author: Simon Flack <simonflk _AT_ cpan.org>'
build_requires:
- Test::More: '0.45'
+ Test::More: '0.88'
configure_requires:
Module::Build: '0.38'
dynamic_config: 1
@@ -17,7 +17,7 @@
provides:
Test::MockModule:
file: lib/Test/MockModule.pm
- version: '0.11'
+ version: '0.12'
requires:
Carp: '0'
SUPER: '0'
@@ -28,5 +28,5 @@
homepage: https://github.com/geofffranks/test-mockmodule
license: http://www.gnu.org/licenses/gpl-3.0.txt
repository: git://github.com/geofffranks/test-mockmodule.git
-version: '0.11'
+version: '0.12'
x_serialization_backend: 'CPAN::Meta::YAML version 0.016'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockModule-0.11/lib/Test/MockModule.pm
new/Test-MockModule-0.12/lib/Test/MockModule.pm
--- old/Test-MockModule-0.11/lib/Test/MockModule.pm 2015-10-28
02:29:14.000000000 +0100
+++ new/Test-MockModule-0.12/lib/Test/MockModule.pm 2017-07-12
22:04:37.000000000 +0200
@@ -4,7 +4,7 @@
use Scalar::Util qw/reftype weaken/;
use Carp;
use SUPER;
-$VERSION = '0.11';
+$VERSION = '0.12';
my %mocked;
sub new {
@@ -74,6 +74,11 @@
}
}
+sub noop {
+ my $self = shift;
+ $self->mock($_,1) for @_;
+}
+
sub original {
my $self = shift;
my ($name) = @_;
@@ -185,7 +190,7 @@
use Foo;
use Test::MockModule;
{
- my $mock = Test::MockModule('Foo');
+ my $mock = Test::MockModule->new('Foo');
$mock->mock(foo => sub { print "Foo!\n"; });
my $foo = Foo->new();
@@ -327,6 +332,14 @@
automatically called when all C<Test::MockObject> objects for the given package
go out of scope.
+=item noop($subroutine [, ...])
+
+Given a list of subroutine names, mocks each of them with a no-op subroutine.
Handy
+for mocking methods you want to ignore!
+
+ # Neuter a list of methods in one go
+ $module->noop('purge', 'updated');
+
=back
=head1 SEE ALSO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockModule-0.11/t/lib/ExampleModule.pm
new/Test-MockModule-0.12/t/lib/ExampleModule.pm
--- old/Test-MockModule-0.11/t/lib/ExampleModule.pm 2015-10-28
02:29:14.000000000 +0100
+++ new/Test-MockModule-0.12/t/lib/ExampleModule.pm 2017-07-12
22:04:37.000000000 +0200
@@ -13,4 +13,8 @@
return;
}
-1;
\ No newline at end of file
+sub cookie {
+ return 'choc-chip';
+}
+
+1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-MockModule-0.11/t/mockmodule.t
new/Test-MockModule-0.12/t/mockmodule.t
--- old/Test-MockModule-0.11/t/mockmodule.t 2015-10-28 02:29:14.000000000
+0100
+++ new/Test-MockModule-0.12/t/mockmodule.t 2017-07-12 22:04:37.000000000
+0200
@@ -121,6 +121,16 @@
$mcgi->mock('param', sub { return 'This sub is mocked' });
is(ExampleModule::param(), 'This sub is mocked', '... mocked params');
ok($mcgi->is_mocked('param'), '... returns true for non-mocked sub');
+
+ # noop()
+ is(ExampleModule::cookie(), 'choc-chip', 'cookie does default
behaviour');
+ $mcgi->noop('cookie');
+ ok($mcgi->is_mocked('cookie'), 'cookie is mocked using noop');
+ $mcgi->unmock('cookie');
+ $mcgi->unmock('Vars');
+ $mcgi->noop('cookie', 'Vars');
+ is(ExampleModule::cookie(), 1, 'now cookie does nothing');
+ is(ExampleModule::Vars(), 1, 'now Vars does nothing');
}
isnt(ExampleModule::param(), 'This sub is mocked',