Hello community,

here is the log from the commit of package perl-Carp-Assert-More for 
openSUSE:Factory checked in at 2019-08-13 13:18:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Carp-Assert-More (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Carp-Assert-More.new.9556 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Carp-Assert-More"

Tue Aug 13 13:18:58 2019 rev:9 rq:722196 version:1.20

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-Carp-Assert-More/perl-Carp-Assert-More.changes  
    2019-07-22 17:18:35.865948566 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-Carp-Assert-More.new.9556/perl-Carp-Assert-More.changes
    2019-08-13 13:20:11.793435245 +0200
@@ -1,0 +2,10 @@
+Sat Aug 10 05:03:19 UTC 2019 - Stephan Kulow <co...@suse.com>
+
+- updated to 1.20
+   see /usr/share/doc/packages/perl-Carp-Assert-More/Changes
+
+  1.20    Fri Aug  9 10:10:06 CDT 2019
+          [ENHANCEMENTS]
+          Add assert_datetime() for asserting DateTime objects.
+
+-------------------------------------------------------------------

Old:
----
  Carp-Assert-More-1.18.tar.gz

New:
----
  Carp-Assert-More-1.20.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Carp-Assert-More.spec ++++++
--- /var/tmp/diff_new_pack.DA6dZW/_old  2019-08-13 13:20:12.341435101 +0200
+++ /var/tmp/diff_new_pack.DA6dZW/_new  2019-08-13 13:20:12.349435099 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Carp-Assert-More
-Version:        1.18
+Version:        1.20
 Release:        0
 %define cpan_name Carp-Assert-More
 Summary:        Convenience wrappers around Carp::Assert

++++++ Carp-Assert-More-1.18.tar.gz -> Carp-Assert-More-1.20.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-1.18/Changes 
new/Carp-Assert-More-1.20/Changes
--- old/Carp-Assert-More-1.18/Changes   2019-07-20 00:14:38.000000000 +0200
+++ new/Carp-Assert-More-1.20/Changes   2019-08-09 17:13:48.000000000 +0200
@@ -1,5 +1,9 @@
 Revision history for Perl extension Carp::Assert::More.
 
+1.20    Fri Aug  9 10:10:06 CDT 2019
+        [ENHANCEMENTS]
+        Add assert_datetime() for asserting DateTime objects.
+
 1.18    Fri Jul 19 17:12:32 CDT 2019
         [ENHANCEMENTS]
         Added assert_aoh() for asserting an array of hashrefs.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-1.18/MANIFEST 
new/Carp-Assert-More-1.20/MANIFEST
--- old/Carp-Assert-More-1.18/MANIFEST  2019-07-20 00:14:58.000000000 +0200
+++ new/Carp-Assert-More-1.20/MANIFEST  2019-08-09 17:14:02.000000000 +0200
@@ -9,6 +9,7 @@
 t/assert_aoh.t
 t/assert_arrayref.t
 t/assert_coderef.t
+t/assert_datetime.t
 t/assert_defined.t
 t/assert_empty.t
 t/assert_exists.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-1.18/META.json 
new/Carp-Assert-More-1.20/META.json
--- old/Carp-Assert-More-1.18/META.json 2019-07-20 00:14:58.000000000 +0200
+++ new/Carp-Assert-More-1.20/META.json 2019-08-09 17:14:02.000000000 +0200
@@ -52,6 +52,6 @@
          "url" : "https://github.com/petdance/carp-assert-more/tree/master";
       }
    },
-   "version" : "1.18",
+   "version" : "1.20",
    "x_serialization_backend" : "JSON::PP version 2.27400"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-1.18/META.yml 
new/Carp-Assert-More-1.20/META.yml
--- old/Carp-Assert-More-1.18/META.yml  2019-07-20 00:14:58.000000000 +0200
+++ new/Carp-Assert-More-1.20/META.yml  2019-08-09 17:14:02.000000000 +0200
@@ -27,5 +27,5 @@
   bugtracker: 
https://rt.cpan.org/Public/Dist/Display.html?Name=Carp-Assert-More
   license: http://www.opensource.org/licenses/artistic-license-2.0.php
   repository: https://github.com/petdance/carp-assert-more/tree/master
-version: '1.18'
+version: '1.20'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.012'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-1.18/More.pm 
new/Carp-Assert-More-1.20/More.pm
--- old/Carp-Assert-More-1.18/More.pm   2019-07-20 00:14:38.000000000 +0200
+++ new/Carp-Assert-More-1.20/More.pm   2019-08-09 17:13:48.000000000 +0200
@@ -15,18 +15,19 @@
 
 =head1 VERSION
 
-Version 1.18
+Version 1.20
 
 =cut
 
 BEGIN {
-    $VERSION = '1.18';
+    $VERSION = '1.20';
     @ISA = qw(Exporter);
     @EXPORT = qw(
         assert_all_keys_in
         assert_aoh
         assert_arrayref
         assert_coderef
+        assert_datetime
         assert_defined
         assert_empty
         assert_exists
@@ -680,6 +681,25 @@
     return assert_isa( $ref, 'CODE', $name );
 }
 
+
+=head1 TYPE-SPECIFIC ASSERTIONS
+
+=head2 assert_datetime( $date )
+
+Asserts that C<$date> is a DateTime object.
+
+=cut
+
+sub assert_datetime {
+    my $datetime = shift;
+    my $desc     = shift // 'Must be a DateTime object';
+
+    assert_isa( $datetime, 'DateTime', $desc );
+
+    return;
+}
+
+
 =head1 SET AND HASH MEMBERSHIP
 
 =head2 assert_in( $string, \@inlist [,$name] );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-1.18/t/assert_datetime.t 
new/Carp-Assert-More-1.20/t/assert_datetime.t
--- old/Carp-Assert-More-1.18/t/assert_datetime.t       1970-01-01 
01:00:00.000000000 +0100
+++ new/Carp-Assert-More-1.20/t/assert_datetime.t       2019-08-09 
17:13:48.000000000 +0200
@@ -0,0 +1,39 @@
+#!perl -Tw
+
+use warnings;
+use strict;
+
+use Test::More;
+
+use Carp::Assert::More;
+
+my $rc = eval 'use DateTime; 1;';
+if ( !$rc ) {
+    plan skip_all => 'DateTime must be installed to test assert_datetime()';
+}
+
+plan tests => 11;
+
+my %bad = (
+    'hashref'     => {},
+    'undef'       => undef,
+    'integer'     => 17,
+    'coderef'     => \&like,
+    'date string' => '1941-12-07',
+);
+
+while ( my ($desc,$val) = each %bad ) {
+    my $rc = eval { assert_datetime( $val ); 1 };
+
+    is( $rc, undef, "assertion did not pass: $desc" );
+    like( $@, qr/Assertion.+failed/, "Error message matches: $desc" );
+}
+
+
+my $dt = DateTime->now;
+assert_datetime( $dt );
+pass( 'Got past a valid assertion' );
+
+
+done_testing();
+exit 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-1.18/t/test-coverage.t 
new/Carp-Assert-More-1.20/t/test-coverage.t
--- old/Carp-Assert-More-1.18/t/test-coverage.t 2019-07-20 00:14:38.000000000 
+0200
+++ new/Carp-Assert-More-1.20/t/test-coverage.t 2019-08-09 17:13:48.000000000 
+0200
@@ -1,6 +1,6 @@
 #!perl -Tw
 
-use Test::More tests => 33;
+use Test::More tests => 34;
 
 use Carp::Assert::More;
 


Reply via email to