Hello community, here is the log from the commit of package perl-Class-Tiny for openSUSE:Factory checked in at 2013-11-26 19:24:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Class-Tiny (Old) and /work/SRC/openSUSE:Factory/.perl-Class-Tiny.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Class-Tiny" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Class-Tiny/perl-Class-Tiny.changes 2013-10-21 15:13:02.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Class-Tiny.new/perl-Class-Tiny.changes 2013-11-26 19:24:29.000000000 +0100 @@ -1,0 +2,10 @@ +Mon Nov 25 07:39:21 UTC 2013 - [email protected] + +- updated to 0.012 + [DOCUMENTED] + - added documentation notes about multiple inheritance + and attribute defaults under subclassing + [INTERNAL] + - added tests for multiple inheritance + +------------------------------------------------------------------- Old: ---- Class-Tiny-0.011.tar.gz New: ---- Class-Tiny-0.012.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Class-Tiny.spec ++++++ --- /var/tmp/diff_new_pack.ByuVZz/_old 2013-11-26 19:24:29.000000000 +0100 +++ /var/tmp/diff_new_pack.ByuVZz/_new 2013-11-26 19:24:29.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-Class-Tiny -Version: 0.011 +Version: 0.012 Release: 0 %define cpan_name Class-Tiny Summary: Minimalist class construction @@ -31,10 +31,12 @@ BuildRequires: perl-macros BuildRequires: perl(Test::More) >= 0.96 #BuildRequires: perl(Alfa) +#BuildRequires: perl(Baker) #BuildRequires: perl(Class::Tiny) #BuildRequires: perl(Delta) #BuildRequires: perl(Devel::GlobalDestruction) #BuildRequires: perl(Golf) +#BuildRequires: perl(India) #BuildRequires: perl(Pod::Wordlist) #BuildRequires: perl(Test::FailWarnings) #BuildRequires: perl(Test::Spelling) >= 0.12 ++++++ Class-Tiny-0.011.tar.gz -> Class-Tiny-0.012.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/Changes new/Class-Tiny-0.012/Changes --- old/Class-Tiny-0.011/Changes 2013-09-25 17:08:11.000000000 +0200 +++ new/Class-Tiny-0.012/Changes 2013-11-01 21:36:39.000000000 +0100 @@ -1,5 +1,16 @@ Revision history for Class-Tiny +0.012 2013-11-01 16:36:35 America/New_York + + [DOCUMENTED] + + - added documentation notes about multiple inheritance + and attribute defaults under subclassing + + [INTERNAL] + + - added tests for multiple inheritance + 0.011 2013-09-25 11:08:07 America/New_York [FIXED] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/MANIFEST new/Class-Tiny-0.012/MANIFEST --- old/Class-Tiny-0.011/MANIFEST 2013-09-25 17:08:11.000000000 +0200 +++ new/Class-Tiny-0.012/MANIFEST 2013-11-01 21:36:39.000000000 +0100 @@ -10,7 +10,6 @@ dist.ini lib/Class/Tiny.pm perlcritic.rc -t/00-compile.t t/00-report-prereqs.t t/alfa.t t/baker.t @@ -20,6 +19,7 @@ t/foxtrot.t t/golf.t t/hotel.t +t/juliett.t t/lib/Alfa.pm t/lib/Baker.pm t/lib/Charlie.pm @@ -28,8 +28,11 @@ t/lib/Foxtrot.pm t/lib/Golf.pm t/lib/Hotel.pm +t/lib/India.pm +t/lib/Juliett.pm t/lib/TestUtils.pm tidyall.ini +xt/author/00-compile.t xt/author/critic.t xt/author/pod-spell.t xt/release/distmeta.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/META.json new/Class-Tiny-0.012/META.json --- old/Class-Tiny-0.011/META.json 2013-09-25 17:08:11.000000000 +0200 +++ new/Class-Tiny-0.012/META.json 2013-11-01 21:36:39.000000000 +0100 @@ -4,7 +4,7 @@ "David Golden <[email protected]>" ], "dynamic_config" : 1, - "generated_by" : "Dist::Zilla version 4.300039, CPAN::Meta::Converter version 2.132660", + "generated_by" : "Dist::Zilla version 5.003, CPAN::Meta::Converter version 2.132830", "license" : [ "apache_2_0" ], @@ -32,8 +32,13 @@ }, "develop" : { "requires" : { + "File::Spec" : "0", + "File::Temp" : "0", + "IO::Handle" : "0", + "IPC::Open3" : "0", "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Meta" : "0", + "Test::More" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08" } @@ -48,16 +53,14 @@ }, "test" : { "recommends" : { + "CPAN::Meta" : "0", + "CPAN::Meta::Requirements" : "0", "Test::FailWarnings" : "0" }, "requires" : { "Exporter" : "0", "ExtUtils::MakeMaker" : "0", - "File::Spec" : "0", "File::Spec::Functions" : "0", - "File::Temp" : "0", - "IO::Handle" : "0", - "IPC::Open3" : "0", "List::Util" : "0", "Test::More" : "0.96", "base" : "0", @@ -69,11 +72,11 @@ "provides" : { "Class::Tiny" : { "file" : "lib/Class/Tiny.pm", - "version" : "0.011" + "version" : "0.012" }, "Class::Tiny::Object" : { "file" : "lib/Class/Tiny.pm", - "version" : "0.011" + "version" : "0.012" } }, "release_status" : "stable", @@ -88,9 +91,10 @@ "web" : "https://github.com/dagolden/Class-Tiny" } }, - "version" : "0.011", + "version" : "0.012", "x_authority" : "cpan:DAGOLDEN", "x_contributors" : [ + "Gelu Lupas <[email protected]>", "Karen Etheridge <[email protected]>", "Matt S Trout <[email protected]>", "Olivier Mengu\u00e9 <[email protected]>", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/META.yml new/Class-Tiny-0.012/META.yml --- old/Class-Tiny-0.011/META.yml 2013-09-25 17:08:11.000000000 +0200 +++ new/Class-Tiny-0.012/META.yml 2013-11-01 21:36:39.000000000 +0100 @@ -5,11 +5,7 @@ build_requires: Exporter: 0 ExtUtils::MakeMaker: 0 - File::Spec: 0 File::Spec::Functions: 0 - File::Temp: 0 - IO::Handle: 0 - IPC::Open3: 0 List::Util: 0 Test::More: 0.96 base: 0 @@ -18,7 +14,7 @@ configure_requires: ExtUtils::MakeMaker: 6.17 dynamic_config: 1 -generated_by: 'Dist::Zilla version 4.300039, CPAN::Meta::Converter version 2.132660' +generated_by: 'Dist::Zilla version 5.003, CPAN::Meta::Converter version 2.132830' license: apache meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -35,10 +31,10 @@ provides: Class::Tiny: file: lib/Class/Tiny.pm - version: 0.011 + version: 0.012 Class::Tiny::Object: file: lib/Class/Tiny.pm - version: 0.011 + version: 0.012 requires: Carp: 0 perl: 5.008001 @@ -48,9 +44,10 @@ bugtracker: https://github.com/dagolden/Class-Tiny/issues homepage: https://github.com/dagolden/Class-Tiny repository: https://github.com/dagolden/Class-Tiny.git -version: 0.011 +version: 0.012 x_authority: cpan:DAGOLDEN x_contributors: + - 'Gelu Lupas <[email protected]>' - 'Karen Etheridge <[email protected]>' - 'Matt S Trout <[email protected]>' - 'Olivier Mengué <[email protected]>' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/Makefile.PL new/Class-Tiny-0.012/Makefile.PL --- old/Class-Tiny-0.011/Makefile.PL 2013-09-25 17:08:11.000000000 +0200 +++ new/Class-Tiny-0.012/Makefile.PL 2013-11-01 21:36:39.000000000 +0100 @@ -27,48 +27,39 @@ "TEST_REQUIRES" => { "Exporter" => 0, "ExtUtils::MakeMaker" => 0, - "File::Spec" => 0, "File::Spec::Functions" => 0, - "File::Temp" => 0, - "IO::Handle" => 0, - "IPC::Open3" => 0, "List::Util" => 0, "Test::More" => "0.96", "base" => 0, "lib" => 0, "subs" => 0 }, - "VERSION" => "0.011", + "VERSION" => "0.012", "test" => { "TESTS" => "t/*.t" } ); -unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { - my $tr = delete $WriteMakefileArgs{TEST_REQUIRES}; - my $br = $WriteMakefileArgs{BUILD_REQUIRES}; - for my $mod ( keys %$tr ) { - if ( exists $br->{$mod} ) { - $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; - } - else { - $br->{$mod} = $tr->{$mod}; - } - } -} +my %FallbackPrereqs = ( + "Carp" => 0, + "Exporter" => 0, + "ExtUtils::MakeMaker" => 0, + "File::Spec::Functions" => 0, + "List::Util" => 0, + "Test::More" => "0.96", + "base" => 0, + "lib" => 0, + "strict" => 0, + "subs" => 0, + "warnings" => 0 +); -unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { - my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; - my $pp = $WriteMakefileArgs{PREREQ_PM}; - for my $mod ( keys %$br ) { - if ( exists $pp->{$mod} ) { - $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; - } - else { - $pp->{$mod} = $br->{$mod}; - } - } + +unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { + delete $WriteMakefileArgs{TEST_REQUIRES}; + delete $WriteMakefileArgs{BUILD_REQUIRES}; + $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/README new/Class-Tiny-0.012/README --- old/Class-Tiny-0.011/README 2013-09-25 17:08:11.000000000 +0200 +++ new/Class-Tiny-0.012/README 2013-11-01 21:36:39.000000000 +0100 @@ -2,7 +2,7 @@ Class::Tiny - Minimalist class construction VERSION - version 0.011 + version 0.012 SYNOPSIS In Person.pm: @@ -58,6 +58,9 @@ * "DESTROY" calls "DEMOLISH" for each class from child to parent + Multiple-inheritance is possible, with superclass order determined via + mro::get_linear_isa. + It uses no non-core modules for any recent Perl. On Perls older than v5.10 it requires MRO::Compat. On Perls older than v5.14, it requires Devel::GlobalDestruction. @@ -98,6 +101,10 @@ hire_date => sub { $_[0]->_build_hire_date }, }; + When subclassing, if multiple accessors of the same name exist in + different classes, any default (or lack of default) is determined by + standard method resolution order. + To make your own custom accessors, just pre-declare the method name before loading Class::Tiny: @@ -284,6 +291,8 @@ David Golden <[email protected]> CONTRIBUTORS + * Gelu Lupas <[email protected]> + * Karen Etheridge <[email protected]> * Matt S Trout <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/cpanfile new/Class-Tiny-0.012/cpanfile --- old/Class-Tiny-0.011/cpanfile 2013-09-25 17:08:11.000000000 +0200 +++ new/Class-Tiny-0.012/cpanfile 2013-11-01 21:36:39.000000000 +0100 @@ -6,11 +6,7 @@ on 'test' => sub { requires "Exporter" => "0"; requires "ExtUtils::MakeMaker" => "0"; - requires "File::Spec" => "0"; requires "File::Spec::Functions" => "0"; - requires "File::Temp" => "0"; - requires "IO::Handle" => "0"; - requires "IPC::Open3" => "0"; requires "List::Util" => "0"; requires "Test::More" => "0.96"; requires "base" => "0"; @@ -19,6 +15,8 @@ }; on 'test' => sub { + recommends "CPAN::Meta" => "0"; + recommends "CPAN::Meta::Requirements" => "0"; recommends "Test::FailWarnings" => "0"; }; @@ -27,8 +25,13 @@ }; on 'develop' => sub { + requires "File::Spec" => "0"; + requires "File::Temp" => "0"; + requires "IO::Handle" => "0"; + requires "IPC::Open3" => "0"; requires "Pod::Coverage::TrustPod" => "0"; requires "Test::CPAN::Meta" => "0"; + requires "Test::More" => "0"; requires "Test::Pod" => "1.41"; requires "Test::Pod::Coverage" => "1.08"; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/lib/Class/Tiny.pm new/Class-Tiny-0.012/lib/Class/Tiny.pm --- old/Class-Tiny-0.011/lib/Class/Tiny.pm 2013-09-25 17:08:11.000000000 +0200 +++ new/Class-Tiny-0.012/lib/Class/Tiny.pm 2013-11-01 21:36:39.000000000 +0100 @@ -6,7 +6,7 @@ package Class::Tiny; # ABSTRACT: Minimalist class construction -our $VERSION = '0.011'; # VERSION +our $VERSION = '0.012'; # VERSION use Carp (); @@ -79,7 +79,7 @@ package Class::Tiny::Object; # ABSTRACT: Base class for classes built with Class::Tiny -our $VERSION = '0.011'; # VERSION +our $VERSION = '0.012'; # VERSION my ( %LINEAR_ISA_CACHE, %BUILD_CACHE, %DEMOLISH_CACHE, %CAN_CACHE ); @@ -163,7 +163,7 @@ =pod -=encoding utf-8 +=encoding UTF-8 =head1 NAME @@ -171,7 +171,7 @@ =head1 VERSION -version 0.011 +version 0.012 =head1 SYNOPSIS @@ -253,13 +253,13 @@ =back +Multiple-inheritance is possible, with superclass order determined via +L<mro::get_linear_isa|mro/Functions>. + It uses no non-core modules for any recent Perl. On Perls older than v5.10 it requires L<MRO::Compat>. On Perls older than v5.14, it requires L<Devel::GlobalDestruction>. -=for Pod::Coverage new get_all_attributes_for get_all_attribute_defaults_for -prepare_class create_attributes - =head1 USAGE =head2 Defining attributes @@ -297,6 +297,10 @@ hire_date => sub { $_[0]->_build_hire_date }, }; +When subclassing, if multiple accessors of the same name exist in different +classes, any default (or lack of default) is determined by standard +method resolution order. + To make your own custom accessors, just pre-declare the method name before loading Class::Tiny: @@ -436,6 +440,9 @@ in place before creating objects. (You don't want to be changing that once you create objects anyway, right?) +=for Pod::Coverage new get_all_attributes_for get_all_attribute_defaults_for +prepare_class create_attributes + =head1 RATIONALE =head2 Why this instead of Object::Tiny or Class::Accessor or something else? @@ -499,6 +506,10 @@ =item * +Gelu Lupas <[email protected]> + +=item * + Karen Etheridge <[email protected]> =item * @@ -507,7 +518,7 @@ =item * -Olivier Mengu� <[email protected]> +Olivier Mengué <[email protected]> =item * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/t/00-compile.t new/Class-Tiny-0.012/t/00-compile.t --- old/Class-Tiny-0.011/t/00-compile.t 2013-09-25 17:08:11.000000000 +0200 +++ new/Class-Tiny-0.012/t/00-compile.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,49 +0,0 @@ -use strict; -use warnings; - -# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.033 - -use Test::More tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); - - - -my @module_files = ( - 'Class/Tiny.pm' -); - - - -# fake home for cpan-testers -use File::Temp; -local $ENV{HOME} = File::Temp::tempdir( CLEANUP => 1 ); - - -use File::Spec; -use IPC::Open3; -use IO::Handle; - -my @warnings; -for my $lib (@module_files) -{ - # see L<perlfaq8/How can I capture STDERR from an external command?> - open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; - my $stderr = IO::Handle->new; - - my $pid = open3($stdin, '>&STDERR', $stderr, $^X, '-Mblib', '-e', "require q[$lib]"); - binmode $stderr, ':crlf' if $^O eq 'MSWin32'; - my @_warnings = <$stderr>; - waitpid($pid, 0); - is($? >> 8, 0, "$lib loaded ok"); - - if (@_warnings) - { - warn @_warnings; - push @warnings, @_warnings; - } -} - - - -is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING}; - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/t/00-report-prereqs.t new/Class-Tiny-0.012/t/00-report-prereqs.t --- old/Class-Tiny-0.011/t/00-report-prereqs.t 2013-09-25 17:08:11.000000000 +0200 +++ new/Class-Tiny-0.012/t/00-report-prereqs.t 2013-11-01 21:36:39.000000000 +0100 @@ -3,6 +3,8 @@ use strict; use warnings; +# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.010 + use Test::More tests => 1; use ExtUtils::MakeMaker; @@ -10,14 +12,12 @@ use List::Util qw/max/; my @modules = qw( + CPAN::Meta + CPAN::Meta::Requirements Carp Exporter ExtUtils::MakeMaker - File::Spec File::Spec::Functions - File::Temp - IO::Handle - IPC::Open3 List::Util Test::FailWarnings Test::More @@ -29,20 +29,46 @@ warnings ); +my %exclude = map {; $_ => 1 } qw( + +); + +my ($source) = grep { -f $_ } qw/MYMETA.json MYMETA.yml META.json/; +$source = "META.yml" unless defined $source; + # replace modules with dynamic results from MYMETA.json if we can # (hide CPAN::Meta from prereq scanner) my $cpan_meta = "CPAN::Meta"; -if ( -f "MYMETA.json" && eval "require $cpan_meta" ) { ## no critic - if ( my $meta = eval { CPAN::Meta->load_file("MYMETA.json") } ) { +my $cpan_meta_req = "CPAN::Meta::Requirements"; +my $all_requires; +if ( -f $source && eval "require $cpan_meta" ) { ## no critic + if ( my $meta = eval { CPAN::Meta->load_file($source) } ) { + + # Get ALL modules mentioned in META (any phase/type) my $prereqs = $meta->prereqs; - delete $prereqs->{develop}; + delete $prereqs->{develop} if not $ENV{AUTHOR_TESTING}; my %uniq = map {$_ => 1} map { keys %$_ } map { values %$_ } values %$prereqs; $uniq{$_} = 1 for @modules; # don't lose any static ones - @modules = sort keys %uniq; + @modules = sort grep { ! $exclude{$_} } keys %uniq; + + # If verifying, merge 'requires' only for major phases + if ( 1 ) { + $prereqs = $meta->effective_prereqs; # get the object, not the hash + if (eval "require $cpan_meta_req; 1") { ## no critic + $all_requires = $cpan_meta_req->new; + for my $phase ( qw/configure build test runtime/ ) { + $all_requires->add_requirements( + $prereqs->requirements_for($phase, 'requires') + ); + } + } + } } } my @reports = [qw/Version Module/]; +my @dep_errors; +my $req_hash = defined($all_requires) ? $all_requires->as_string_hash : {}; for my $mod ( @modules ) { next if $mod eq 'perl'; @@ -54,9 +80,29 @@ my $ver = MM->parse_version( catfile($prefix, $file) ); $ver = "undef" unless defined $ver; # Newer MM should do this anyway push @reports, [$ver, $mod]; + + if ( 1 && $all_requires ) { + my $req = $req_hash->{$mod}; + if ( defined $req && length $req ) { + if ( ! defined eval { version->parse($ver) } ) { + push @dep_errors, "$mod version '$ver' cannot be parsed (version '$req' required)"; + } + elsif ( ! $all_requires->accepts_module( $mod => $ver ) ) { + push @dep_errors, "$mod version '$ver' is not in required range '$req'"; + } + } + } + } else { push @reports, ["missing", $mod]; + + if ( 1 && $all_requires ) { + my $req = $req_hash->{$mod}; + if ( defined $req && length $req ) { + push @dep_errors, "$mod is not installed (version '$req' required)"; + } + } } } @@ -64,7 +110,17 @@ my $vl = max map { length $_->[0] } @reports; my $ml = max map { length $_->[1] } @reports; splice @reports, 1, 0, ["-" x $vl, "-" x $ml]; - diag "Prerequisite Report:\n", map {sprintf(" %*s %*s\n",$vl,$_->[0],-$ml,$_->[1])} @reports; + diag "\nVersions for all modules listed in $source (including optional ones):\n", + map {sprintf(" %*s %*s\n",$vl,$_->[0],-$ml,$_->[1])} @reports; +} + +if ( @dep_errors ) { + diag join("\n", + "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n", + "The following REQUIRED prerequisites were not satisfied:\n", + @dep_errors, + "\n" + ); } pass; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/t/juliett.t new/Class-Tiny-0.012/t/juliett.t --- old/Class-Tiny-0.011/t/juliett.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Class-Tiny-0.012/t/juliett.t 2013-11-01 21:36:39.000000000 +0100 @@ -0,0 +1,98 @@ +use 5.008001; +use strict; +use warnings; +use lib 't/lib'; + +use Test::More 0.96; +use TestUtils; + +require_ok("Juliett"); + +subtest "attribute list" => sub { + is_deeply( + [ sort Class::Tiny->get_all_attributes_for("Juliett") ], + [ sort qw/foo bar baz qux kit/ ], + "attribute list correct", + ); +}; + +subtest "empty list constructor" => sub { + my $obj = new_ok("Juliett"); + is( $obj->foo, undef, "foo is undef" ); + is( $obj->bar, undef, "bar is undef" ); + is( $obj->baz, undef, "baz is undef" ); + is( $obj->qux, undef, "qux is undef" ); + is( $obj->kit, undef, "kit is undef" ); +}; + +subtest "empty hash object constructor" => sub { + my $obj = new_ok( "Juliett", [ {} ] ); + is( $obj->foo, undef, "foo is undef" ); + is( $obj->bar, undef, "bar is undef" ); + is( $obj->baz, undef, "baz is undef" ); + is( $obj->qux, undef, "qux is undef" ); + is( $obj->kit, undef, "kit is undef" ); +}; + +subtest "subclass attribute set as list" => sub { + my $obj = new_ok( "Juliett", [ kit => 23 ] ); + is( $obj->foo, undef, "foo is undef" ); + is( $obj->bar, undef, "bar is undef" ); + is( $obj->qux, undef, "baz is undef" ); + is( $obj->qux, undef, "qux is undef" ); + is( $obj->kit, 23, "kit is set" ); +}; + +subtest "superclass attribute set as list" => sub { + my $obj = new_ok( "Juliett", [ bar => 42, baz => 23, qux => 13, kit => 31 ] ); + is( $obj->foo, undef, "foo is undef" ); + is( $obj->bar, 42, "bar is set" ); + is( $obj->baz, 23, "baz is set" ); + is( $obj->qux, 13, "qux is set" ); + is( $obj->kit, 31, "kit is set" ); +}; + +subtest "all attributes set as list" => sub { + my $obj = + new_ok( "Juliett", [ foo => 13, bar => 42, baz => 23, qux => 11, kit => 31 ] ); + is( $obj->foo, 13, "foo is set" ); + is( $obj->bar, 42, "bar is set" ); + is( $obj->baz, 23, "baz is set" ); + is( $obj->qux, 11, "qux is set" ); + is( $obj->kit, 31, "kit is set" ); +}; + +subtest "attributes are RW" => sub { + my $obj = new_ok( "Juliett", [ { foo => 23, bar => 42 } ] ); + is( $obj->foo(24), 24, "changing foo returns new value" ); + is( $obj->foo, 24, "accessing foo returns changed value" ); + is( $obj->baz(42), 42, "changing baz returns new value" ); + is( $obj->baz, 42, "accessing baz returns changed value" ); + is( $obj->qux(11), 11, "changing qux returns new value" ); + is( $obj->qux, 11, "accessing qux returns changed value" ); + is( $obj->kit(31), 31, "changing kit returns new value" ); + is( $obj->kit, 31, "accessing kit rerutns changed value" ); +}; + +subtest "exceptions" => sub { + like( + exception { + Juliett->new( foo => 23, bar => 42, baz => 13, qux => 11, kit => 31, wibble => 0 ); + }, + qr/Invalid attributes for Juliett: wibble/, + "creating object with 'wibble' dies", + ); + +}; + +done_testing; +# +# This file is part of Class-Tiny +# +# This software is Copyright (c) 2013 by David Golden. +# +# This is free software, licensed under: +# +# The Apache License, Version 2.0, January 2004 +# +# vim: ts=4 sts=4 sw=4 et: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/t/lib/India.pm new/Class-Tiny-0.012/t/lib/India.pm --- old/Class-Tiny-0.011/t/lib/India.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/Class-Tiny-0.012/t/lib/India.pm 2013-11-01 21:36:39.000000000 +0100 @@ -0,0 +1,10 @@ +use 5.008001; +use strict; +use warnings; + +package India; +use base 'Alfa'; + +use Class::Tiny qw/qux/; + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/t/lib/Juliett.pm new/Class-Tiny-0.012/t/lib/Juliett.pm --- old/Class-Tiny-0.011/t/lib/Juliett.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/Class-Tiny-0.012/t/lib/Juliett.pm 2013-11-01 21:36:39.000000000 +0100 @@ -0,0 +1,10 @@ +use 5.008001; +use strict; +use warnings; + +package Juliett; +use base 'Baker', 'India'; + +use Class::Tiny qw/kit/; + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/xt/author/00-compile.t new/Class-Tiny-0.012/xt/author/00-compile.t --- old/Class-Tiny-0.011/xt/author/00-compile.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Class-Tiny-0.012/xt/author/00-compile.t 2013-11-01 21:36:39.000000000 +0100 @@ -0,0 +1,51 @@ +use strict; +use warnings; + +# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.037 + +use Test::More tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); + + + +my @module_files = ( + 'Class/Tiny.pm' +); + + + +# fake home for cpan-testers +use File::Temp; +local $ENV{HOME} = File::Temp::tempdir( CLEANUP => 1 ); + + +my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; + +use File::Spec; +use IPC::Open3; +use IO::Handle; + +my @warnings; +for my $lib (@module_files) +{ + # see L<perlfaq8/How can I capture STDERR from an external command?> + open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; + my $stderr = IO::Handle->new; + + my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); + binmode $stderr, ':crlf' if $^O eq 'MSWin32'; + my @_warnings = <$stderr>; + waitpid($pid, 0); + is($?, 0, "$lib loaded ok"); + + if (@_warnings) + { + warn @_warnings; + push @warnings, @_warnings; + } +} + + + +is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING}; + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Tiny-0.011/xt/author/pod-spell.t new/Class-Tiny-0.012/xt/author/pod-spell.t --- old/Class-Tiny-0.011/xt/author/pod-spell.t 2013-09-25 17:08:11.000000000 +0200 +++ new/Class-Tiny-0.012/xt/author/pod-spell.t 2013-11-01 21:36:39.000000000 +0100 @@ -17,6 +17,9 @@ David Golden dagolden +Gelu +Lupas +gelu Karen Etheridge ether @@ -24,7 +27,7 @@ Trout mstrout Olivier -Mengu� +Mengué dolmen Toby Inkster -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
