diff --git a/Changes b/Changes index 66885cc..19ab2fb 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,12 @@ +0.15 2011-06-07 + * Standardize the tests' Mouse/Moose loading eval/skip code + (Sartak, reported by Daniel Macks) + - fixes [rt.cpan.org #68657] + +0.14 2011-04-29 + * Skip t/004-x-modules-mouse.t if you don't have MouseX::Types 0.03 since + older versions do not work with modern Mouse (Sartak, reported by ewilhelm) + 0.13 Wed 19 May 2010 * Add load_first_existing_class (gfx) diff --git a/LICENSE b/LICENSE index 3d678f3..d91f8dd 100644 --- a/LICENSE +++ b/LICENSE @@ -18,15 +18,16 @@ The GNU General Public License, Version 1, February 1989 - GNU GENERAL PUBLIC LICENSE - Version 1, February 1989 + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public @@ -67,7 +68,7 @@ The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which @@ -185,7 +186,7 @@ of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -207,9 +208,9 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it @@ -235,8 +236,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA + Also add information on how to contact you by electronic and paper mail. diff --git a/MANIFEST b/MANIFEST index 4829b44..64e9270 100644 --- a/MANIFEST +++ b/MANIFEST @@ -4,6 +4,7 @@ META.yml Makefile.PL README +devel/test-combos.pl dist.ini lib/Any/Moose.pm t/000-version.t diff --git a/META.yml b/META.yml index 9625121..37c6bc1 100644 --- a/META.yml +++ b/META.yml @@ -8,9 +8,9 @@ - 'Goro Fuji ' build_requires: {} configure_requires: - ExtUtils::MakeMaker: 6.31 + ExtUtils::MakeMaker: 6.30 dynamic_config: 0 -generated_by: 'Dist::Zilla version 4.200004, CPAN::Meta::Converter version 2.110360' +generated_by: 'Dist::Zilla version 4.200007, CPAN::Meta::Converter version 2.110440' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -19,4 +19,4 @@ requires: Mouse: 0.40 perl: 5.006_002 -version: 0.14 +version: 0.15 diff --git a/Makefile.PL b/Makefile.PL index b544316..47dd205 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,9 +2,9 @@ use strict; use warnings; -BEGIN { require 5.006_002; } +use 5.006_002; -use ExtUtils::MakeMaker 6.31; +use ExtUtils::MakeMaker 6.30; @@ -13,7 +13,7 @@ 'AUTHOR' => 'Shawn M Moore , Florian Ragwitz , Stevan Little , Tokuhiro Matsuno , Goro Fuji ', 'BUILD_REQUIRES' => {}, 'CONFIGURE_REQUIRES' => { - 'ExtUtils::MakeMaker' => '6.31' + 'ExtUtils::MakeMaker' => '6.30' }, 'DISTNAME' => 'Any-Moose', 'EXE_FILES' => [], @@ -22,7 +22,7 @@ 'PREREQ_PM' => { 'Mouse' => '0.40' }, - 'VERSION' => '0.14', + 'VERSION' => '0.15', 'test' => { 'TESTS' => 't/*.t' } diff --git a/README b/README index 088df84..1bb282e 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ This archive contains the distribution Any-Moose, -version 0.14: +version 0.15: use Moose or Mouse modules diff --git a/devel/test-combos.pl b/devel/test-combos.pl new file mode 100644 index 0000000..295fd43 --- /dev/null +++ b/devel/test-combos.pl @@ -0,0 +1,52 @@ +#!/usr/bin/env perl +use 5.14.0; +use warnings; +use Data::PowerSet 'powerset'; + +my @all_modules = qw(Mouse MouseX::Types Moose MooseX::Types); + +my %results; + +for my $modules (@{ powerset(@all_modules) }) { + my $list = join ',', @$modules; + + say '=' x 60; + say "RUNNING WITHOUT $list"; + say '=' x 60; + + $ENV{PERL5OPT} = "-MTest::Without::Module=$list"; + system("prove"); + + push @{ $results{ $? >> 8 ? "NOT OK" : "OK" } }, $list; +} + +for my $result (sort keys %results) { + my @modules = @{ $results{$result} }; + say "$result when testing without:"; + say "* $_" for @modules; + say ''; +} + +__END__ + +... test results ... + +NOT OK when testing without: +* Mouse,MouseX::Types,Moose,MooseX::Types +* Mouse,Moose,MooseX::Types +* Mouse,MouseX::Types,Moose +* Mouse,Moose + +OK when testing without: +* MouseX::Types,Moose,MooseX::Types +* Moose,MooseX::Types +* Mouse,MouseX::Types,MooseX::Types +* MouseX::Types,MooseX::Types +* Mouse,MooseX::Types +* MooseX::Types +* MouseX::Types,Moose +* Moose +* Mouse,MouseX::Types +* MouseX::Types +* Mouse +* diff --git a/dist.ini b/dist.ini index f1049c2..21d46e4 100644 --- a/dist.ini +++ b/dist.ini @@ -1,5 +1,5 @@ name = Any-Moose -version = 0.14 +version = 0.15 author = Shawn M Moore author = Florian Ragwitz author = Stevan Little @@ -14,6 +14,6 @@ [PodWeaver] -[Prereq] +[Prereqs] Mouse = 0.40 perl = 5.006_002 diff --git a/lib/Any/Moose.pm b/lib/Any/Moose.pm index 45518c4..921ac2a 100644 --- a/lib/Any/Moose.pm +++ b/lib/Any/Moose.pm @@ -1,6 +1,6 @@ package Any::Moose; BEGIN { - $Any::Moose::VERSION = '0.14'; + $Any::Moose::VERSION = '0.15'; } # ABSTRACT: use Moose or Mouse modules @@ -236,7 +236,7 @@ =head1 VERSION -version 0.14 +version 0.15 =head1 SYNOPSIS diff --git a/t/000-version.t b/t/000-version.t index 78433a8..b16ef7c 100644 --- a/t/000-version.t +++ b/t/000-version.t @@ -12,10 +12,10 @@ sub show_version { my $klass = shift; - if (eval "require $klass; 1;") { + if (eval "use $klass (); 1") { no strict 'refs'; diag "$klass: " . ${"${klass}::VERSION"}; } else { - diag "$klass not found"; + diag "$klass unavailable: $@"; } } diff --git a/t/001-basic-moose.t b/t/001-basic-moose.t index 3e7a13d..08fbe1c 100644 --- a/t/001-basic-moose.t +++ b/t/001-basic-moose.t @@ -6,8 +6,8 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - eval 'require Moose'; - plan skip_all => 'Moose not available' if $@; + eval 'use Moose ()'; + plan skip_all => "Moose unavailable: $@" if $@; plan tests => 9; } diff --git a/t/001-basic-mouse.t b/t/001-basic-mouse.t index 69c4d6e..8a94ad4 100644 --- a/t/001-basic-mouse.t +++ b/t/001-basic-mouse.t @@ -6,8 +6,8 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - eval 'require Mouse'; - plan skip_all => 'Mouse not available' if $@; + eval 'use Mouse ()'; + plan skip_all => "Mouse unavailable: $@" if $@; plan tests => 9; } @@ -29,9 +29,8 @@ ok(!Moused::Any::Moose->can('has'), "has was unimported"); SKIP: { - my $loaded_moose; - BEGIN { $loaded_moose = eval 'require Moose' } - skip "Moose required for these tests to be useful" => 3 unless $loaded_moose; + eval 'use Moose ()'; + skip "Moose unavailable: $@" => 3 if $@; do { package After::Moose; diff --git a/t/002-other-modules-moose.t b/t/002-other-modules-moose.t index 35459cd..f34abe3 100644 --- a/t/002-other-modules-moose.t +++ b/t/002-other-modules-moose.t @@ -6,8 +6,8 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - eval 'require Moose'; - plan skip_all => 'Moose not available' if $@; + eval 'use Moose ()'; + plan skip_all => "Moose unavailable: $@" if $@; plan tests => 2; } diff --git a/t/002-other-modules-mouse.t b/t/002-other-modules-mouse.t index 38e769e..7a4ea62 100644 --- a/t/002-other-modules-mouse.t +++ b/t/002-other-modules-mouse.t @@ -6,8 +6,8 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - eval 'require Mouse'; - plan skip_all => 'Mouse not available' if $@; + eval 'use Mouse ()'; + plan skip_all => "Mouse unavailable: $@" if $@; plan tests => 2; } @@ -21,9 +21,8 @@ }; SKIP: { - my $loaded_moose; - BEGIN { $loaded_moose = eval 'require Moose' } - skip "Moose required for these tests to be useful" => 1 unless $loaded_moose; + eval 'use Moose ()'; + skip "Moose unavailable: $@" => 1 if $@; do { package After::Moose; diff --git a/t/003-is_moose_loaded.t b/t/003-is_moose_loaded.t index 371e619..a5268ba 100644 --- a/t/003-is_moose_loaded.t +++ b/t/003-is_moose_loaded.t @@ -6,8 +6,8 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - eval 'require Mouse'; - plan skip_all => 'Mouse not available' if $@; + eval 'use Mouse ()'; + plan skip_all => "Mouse unavailable: $@" if $@; plan tests => 3; } @@ -21,8 +21,8 @@ package Foo; BEGIN { SKIP: { - eval 'use Moose'; - ::skip 'Moose not installed', 1 if $@; + eval 'use Moose ()'; + ::skip "Moose unavailable: $@", 1 if $@; ::ok(Any::Moose::_is_moose_loaded(), '... Moose is loaded'); } diff --git a/t/004-x-modules-moose.t b/t/004-x-modules-moose.t index 06d32ec..047c65c 100644 --- a/t/004-x-modules-moose.t +++ b/t/004-x-modules-moose.t @@ -6,8 +6,11 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - eval 'require Moose; require MooseX::Types'; - plan skip_all => 'Moose or MooseX::Types not available' if $@; + eval 'use Moose ()'; + plan skip_all => "Moose unavailable: $@" if $@; + eval 'use MooseX::Types ()'; + plan skip_all => "Moose::Types unavailable: $@" if $@; + plan tests => 2; } diff --git a/t/004-x-modules-mouse.t b/t/004-x-modules-mouse.t index ce7d2e2..15bdd8e 100644 --- a/t/004-x-modules-mouse.t +++ b/t/004-x-modules-mouse.t @@ -6,7 +6,11 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - plan skip_all => 'Mouse or MouseX::Types 0.03 not available' unless eval "require Mouse; require MouseX::Types 0.03;"; + eval 'use Mouse ()'; + plan skip_all => "Mouse unavailable: $@" if $@; + eval 'use MouseX::Types 0.03'; + plan skip_all => "Mouse::Types 0.03 unavailable: $@" if $@; + plan tests => 2; } @@ -19,9 +23,10 @@ }; SKIP: { - my $loaded_moose; - BEGIN { $loaded_moose = eval 'require Moose; require MooseX::Types' } - skip "Moose and MooseX::Types required for these tests to be useful" => 1 unless $loaded_moose; + eval 'use Moose ()'; + skip "Moose unavailable: $@" => 1 if $@; + eval 'use MooseX::Types ()'; + skip "MooseX::Types unavailable: $@" => 1 if $@; do { package After::Moose; diff --git a/t/005-aliases-moose.t b/t/005-aliases-moose.t index 56e2aa9..7a6c3d7 100644 --- a/t/005-aliases-moose.t +++ b/t/005-aliases-moose.t @@ -6,8 +6,8 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - eval 'require Moose;'; - plan skip_all => 'Moose not available' if $@; + eval 'use Moose ()'; + plan skip_all => "Moose unavailable: $@" if $@; plan tests => 21; } diff --git a/t/005-aliases-mouse.t b/t/005-aliases-mouse.t index 2a8fab8..68740f9 100644 --- a/t/005-aliases-mouse.t +++ b/t/005-aliases-mouse.t @@ -6,8 +6,8 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - eval 'require Mouse;'; - plan skip_all => 'Mouse not available' if $@; + eval 'use Mouse ()'; + plan skip_all => "Mouse unavailable: $@" if $@; plan tests => 21; } diff --git a/t/010-use_mouse_roles.t b/t/010-use_mouse_roles.t index 82b5160..fbd2fc2 100644 --- a/t/010-use_mouse_roles.t +++ b/t/010-use_mouse_roles.t @@ -6,8 +6,8 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - eval 'require Mouse'; - plan skip_all => 'Mouse not available' if $@; + eval 'use Mouse ()'; + plan skip_all => "Mouse unavailable: $@" if $@; plan tests => 1; } diff --git a/t/011-use_moose_roles.t b/t/011-use_moose_roles.t index d65888e..427d13a 100644 --- a/t/011-use_moose_roles.t +++ b/t/011-use_moose_roles.t @@ -6,8 +6,8 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - eval 'require Moose'; - plan skip_all => 'Moose not available' if $@; + eval 'use Moose ()'; + plan skip_all => "Moose unavailable: $@" if $@; plan tests => 1; } diff --git a/t/012-use_moose_util.t b/t/012-use_moose_util.t index ee12cfe..b55458a 100644 --- a/t/012-use_moose_util.t +++ b/t/012-use_moose_util.t @@ -6,8 +6,8 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - eval 'require Moose'; - plan skip_all => 'Moose not available' if $@; + eval 'use Moose ()'; + plan skip_all => "Moose unavailable: $@" if $@; plan tests => 2; } diff --git a/t/012-use_mouse_util.t b/t/012-use_mouse_util.t index bb8f6b5..6c4e1f9 100644 --- a/t/012-use_mouse_util.t +++ b/t/012-use_mouse_util.t @@ -6,8 +6,8 @@ BEGIN { delete $ENV{ANY_MOOSE} } BEGIN { - eval 'require Mouse'; - plan skip_all => 'Mouse not available' if $@; + eval 'use Mouse ()'; + plan skip_all => "Mouse unavailable: $@" if $@; plan tests => 2; }