r53239 - in /branches/upstream/libmoosex-types-common-perl/current: Changes MANIFEST META.yml Makefile.PL lib/MooseX/Types/Common.pm t/03-idiot.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Tue Feb 23 01:49:24 UTC 2010


Author: jawnsy-guest
Date: Tue Feb 23 01:49:17 2010
New Revision: 53239

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=53239
Log:
[svn-upgrade] Integrating new upstream version, libmoosex-types-common-perl (0.001002)

Added:
    branches/upstream/libmoosex-types-common-perl/current/t/03-idiot.t
Modified:
    branches/upstream/libmoosex-types-common-perl/current/Changes
    branches/upstream/libmoosex-types-common-perl/current/MANIFEST
    branches/upstream/libmoosex-types-common-perl/current/META.yml
    branches/upstream/libmoosex-types-common-perl/current/Makefile.PL
    branches/upstream/libmoosex-types-common-perl/current/lib/MooseX/Types/Common.pm

Modified: branches/upstream/libmoosex-types-common-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-types-common-perl/current/Changes?rev=53239&op=diff
==============================================================================
--- branches/upstream/libmoosex-types-common-perl/current/Changes (original)
+++ branches/upstream/libmoosex-types-common-perl/current/Changes Tue Feb 23 01:49:17 2010
@@ -1,4 +1,8 @@
+0.001002 2010-02-22 17:00EST
+  - Add Test::Exception to the test_requires (RT#54357)
+  - Warning when you try to import things from MooseX::Types::Common rather
+    than one of the specific String/Numeric modules in the distribution.
 0.001001 2010-01-04
   - POD updates
 0.001000
-  - Initial release. This is a spin off from Reaction.
+  - Initial release. This is a spin off from Reaction.

Modified: branches/upstream/libmoosex-types-common-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-types-common-perl/current/MANIFEST?rev=53239&op=diff
==============================================================================
--- branches/upstream/libmoosex-types-common-perl/current/MANIFEST (original)
+++ branches/upstream/libmoosex-types-common-perl/current/MANIFEST Tue Feb 23 01:49:17 2010
@@ -17,3 +17,4 @@
 t/00-load.t
 t/01-string.t
 t/02-numeric.t
+t/03-idiot.t

Modified: branches/upstream/libmoosex-types-common-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-types-common-perl/current/META.yml?rev=53239&op=diff
==============================================================================
--- branches/upstream/libmoosex-types-common-perl/current/META.yml (original)
+++ branches/upstream/libmoosex-types-common-perl/current/META.yml Tue Feb 23 01:49:17 2010
@@ -4,6 +4,7 @@
   - 'This distribution was extracted from the L<Reaction> code base by Guillermo'
 build_requires:
   ExtUtils::MakeMaker: 6.42
+  Test::Exception: 0
   Test::More: 0.62
 configure_requires:
   ExtUtils::MakeMaker: 6.42
@@ -25,4 +26,4 @@
   IRC: irc://irc.perl.org/#moose
   license: http://dev.perl.org/licenses/
   repository: git://git.moose.perl.org/MooseX-Types-Common.git
-version: 0.001001
+version: 0.001002

Modified: branches/upstream/libmoosex-types-common-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-types-common-perl/current/Makefile.PL?rev=53239&op=diff
==============================================================================
--- branches/upstream/libmoosex-types-common-perl/current/Makefile.PL (original)
+++ branches/upstream/libmoosex-types-common-perl/current/Makefile.PL Tue Feb 23 01:49:17 2010
@@ -12,6 +12,7 @@
 
 # things the tests need
 test_requires 'Test::More' => '0.62';
+test_requires 'Test::Exception';
 
 resources 'IRC' => 'irc://irc.perl.org/#moose';
 resources 'license' => 'http://dev.perl.org/licenses/';

Modified: branches/upstream/libmoosex-types-common-perl/current/lib/MooseX/Types/Common.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-types-common-perl/current/lib/MooseX/Types/Common.pm?rev=53239&op=diff
==============================================================================
--- branches/upstream/libmoosex-types-common-perl/current/lib/MooseX/Types/Common.pm (original)
+++ branches/upstream/libmoosex-types-common-perl/current/lib/MooseX/Types/Common.pm Tue Feb 23 01:49:17 2010
@@ -2,8 +2,17 @@
 
 use strict;
 use warnings;
+use Carp qw/cluck/;
 
-our $VERSION = '0.001001';
+our $VERSION = '0.001002';
+
+sub import {
+    my $package = shift;
+    return unless @_;
+    cluck("Tried to import the symbols " . join(', ', @_)
+        . " from MooseX::Types::Common.\nDid you mean "
+        . "MooseX::Types::Common::String or MooseX::Type::Common::Numeric?");
+}
 
 1;
 

Added: branches/upstream/libmoosex-types-common-perl/current/t/03-idiot.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-types-common-perl/current/t/03-idiot.t?rev=53239&op=file
==============================================================================
--- branches/upstream/libmoosex-types-common-perl/current/t/03-idiot.t (added)
+++ branches/upstream/libmoosex-types-common-perl/current/t/03-idiot.t Tue Feb 23 01:49:17 2010
@@ -1,0 +1,28 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+# Test for a warning when you make the stupid mistake I make all the time
+# of saying use MooseX::Types::Common qw/NonEmptySimpleStr/;
+
+BEGIN {
+    eval { require Capture::Tiny }
+        or plan skip_all => 'Capture::Tiny needed for these tests';
+}
+
+plan tests => 4;
+
+use_ok 'MooseX::Types::Common';
+
+my ($stdout, $stderr) = Capture::Tiny::capture(sub {
+    MooseX::Types::Common->import;
+});
+is $stderr, '', 'No warning if nothing imported';
+
+($stdout, $stderr) = Capture::Tiny::capture(sub {
+    MooseX::Types::Common->import('NonEmptySimpleStr');
+});
+like $stderr, qr/Did you mean/, 'Got warning';
+like $stderr, qr/NonEmptySimpleStr/, 'Warning mentions bad type';
+




More information about the Pkg-perl-cvs-commits mailing list