Hello community, here is the log from the commit of package perl-Test-Fatal for openSUSE:Factory checked in at Mon Jun 20 11:49:40 CEST 2011.
-------- --- perl-Test-Fatal/perl-Test-Fatal.changes 2011-04-28 07:42:07.000000000 +0200 +++ /mounts/work_src_done/STABLE/perl-Test-Fatal/perl-Test-Fatal.changes 2011-06-11 03:05:00.000000000 +0200 @@ -1,0 +2,7 @@ +Sat Jun 11 01:01:50 UTC 2011 - [email protected] + +- update to 0.006: + * crank back the Test::More and Exporter requirements + * add lives_ok and dies_ok emulation + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- Test-Fatal-0.005.tar.gz New: ---- Test-Fatal-0.006.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Test-Fatal.spec ++++++ --- /var/tmp/diff_new_pack.bBDs5F/_old 2011-06-20 11:49:06.000000000 +0200 +++ /var/tmp/diff_new_pack.bBDs5F/_new 2011-06-20 11:49:06.000000000 +0200 @@ -21,7 +21,7 @@ Name: perl-Test-Fatal %define cpan_name Test-Fatal Summary: Incredibly simple helpers for testing code with exceptions -Version: 0.005 +Version: 0.006 Release: 1 License: GPL+ or Artistic Group: Development/Libraries/Perl ++++++ Test-Fatal-0.005.tar.gz -> Test-Fatal-0.006.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Fatal-0.005/Changes new/Test-Fatal-0.006/Changes --- old/Test-Fatal-0.005/Changes 2011-04-26 13:50:56.000000000 +0200 +++ new/Test-Fatal-0.006/Changes 2011-06-02 04:55:14.000000000 +0200 @@ -1,5 +1,10 @@ Revision history for Test-Fatal +0.006 2011-06-01 22:55:10 America/New_York + crank back the Test::More and Exporter requirements + + add lives_ok and dies_ok emulation (thanks, Paul "LeoNerd" Evans) + 0.005 2011-04-26 07:50:48 America/New_York fix the logic that picks tests for 5.13.1+ (thanks, Zefram) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Fatal-0.005/LICENSE new/Test-Fatal-0.006/LICENSE --- old/Test-Fatal-0.005/LICENSE 2011-04-26 13:50:56.000000000 +0200 +++ new/Test-Fatal-0.006/LICENSE 2011-06-02 04:55:14.000000000 +0200 @@ -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 + END OF TERMS AND CONDITIONS - Appendix: How to Apply These Terms to Your New Programs + 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Fatal-0.005/MANIFEST new/Test-Fatal-0.006/MANIFEST --- old/Test-Fatal-0.005/MANIFEST 2011-04-26 13:50:56.000000000 +0200 +++ new/Test-Fatal-0.006/MANIFEST 2011-06-02 04:55:14.000000000 +0200 @@ -8,4 +8,5 @@ dist.ini lib/Test/Fatal.pm t/basic.t +t/like-exception.t t/release-pod-syntax.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Fatal-0.005/META.json new/Test-Fatal-0.006/META.json --- old/Test-Fatal-0.005/META.json 2011-04-26 13:50:56.000000000 +0200 +++ new/Test-Fatal-0.006/META.json 2011-06-02 04:55:14.000000000 +0200 @@ -4,7 +4,7 @@ "Ricardo Signes <[email protected]>" ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 4.200005, CPAN::Meta::Converter version 2.110930", + "generated_by" : "Dist::Zilla version 4.200006, CPAN::Meta::Converter version 2.110930", "license" : [ "perl_5" ], @@ -16,142 +16,146 @@ "prereqs" : { "configure" : { "requires" : { - "ExtUtils::MakeMaker" : "6.31" + "ExtUtils::MakeMaker" : "6.30" } }, "runtime" : { "requires" : { "Carp" : 0, - "Exporter" : "5.59", + "Exporter" : "5.57", + "Test::Builder" : 0, "Try::Tiny" : "0.07" } }, "test" : { "requires" : { - "Test::More" : "0.96", + "Test::Builder::Tester" : 0, + "Test::More" : "0.47", "overload" : 0 } } }, "release_status" : "stable", "resources" : { + "homepage" : "http://github.com/rjbs/test-fatal", "repository" : { "type" : "git", - "url" : "git://git.codesimply.com/Test-Fatal.git" + "url" : "http://github.com/rjbs/test-fatal", + "web" : "http://github.com/rjbs/test-fatal" } }, - "version" : "0.005", + "version" : "0.006", "x_Dist_Zilla" : { "plugins" : [ { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@RJBS/CheckPrereqsIndexed", - "version" : "0.002" + "version" : "0.003" }, { "class" : "Dist::Zilla::Plugin::GatherDir", "name" : "@RJBS/@Basic/GatherDir", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RJBS/@Basic/PruneCruft", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@RJBS/@Basic/ManifestSkip", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RJBS/@Basic/MetaYAML", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RJBS/@Basic/License", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@RJBS/@Basic/Readme", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::ExtraTests", "name" : "@RJBS/@Basic/ExtraTests", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RJBS/@Basic/ExecDir", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RJBS/@Basic/ShareDir", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "name" : "@RJBS/@Basic/MakeMaker", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RJBS/@Basic/Manifest", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RJBS/@Basic/TestRelease", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RJBS/@Basic/ConfirmRelease", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RJBS/@Basic/UploadToCPAN", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RJBS/AutoPrereqs", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "name" : "@RJBS/Git::NextVersion", - "version" : "1.110500" + "version" : "1.111460" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@RJBS/PkgVersion", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RJBS/MetaConfig", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RJBS/MetaJSON", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RJBS/NextRelease", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RJBS/PodSyntaxTests", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::Repository", @@ -167,7 +171,7 @@ } }, "name" : "@RJBS/TestMoreWithSubtests", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", @@ -175,44 +179,82 @@ "version" : "3.101641" }, { + "class" : "Dist::Zilla::Plugin::GithubMeta", + "name" : "@RJBS/GithubMeta", + "version" : "0.12" + }, + { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "@RJBS/@Git/Check", - "version" : "1.110500" + "version" : "1.111460" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "name" : "@RJBS/@Git/Commit", - "version" : "1.110500" + "version" : "1.111460" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "name" : "@RJBS/@Git/Tag", - "version" : "1.110500" + "version" : "1.111460" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "name" : "@RJBS/@Git/Push", - "version" : "1.110500" + "version" : "1.111460" + }, + { + "class" : "Dist::Zilla::Plugin::RemovePrereqs", + "config" : { + "Dist::Zilla::Plugin::RemovePrereqs" : { + "modules_to_remove" : [ + "Test::More" + ] + } + }, + "name" : "RemovePrereqs", + "version" : "4.200006" + }, + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "test", + "type" : "requires" + } + }, + "name" : "TestRequires", + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", - "version" : "4.200005" + "version" : "4.200006" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":IncModules", + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", - "version" : "4.200005" + "version" : "4.200006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", - "version" : "4.200005" + "version" : "4.200006" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":MainModule", + "version" : "4.200006" } ], "zilla" : { @@ -220,7 +262,7 @@ "config" : { "is_trial" : 0 }, - "version" : "4.200005" + "version" : "4.200006" } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Fatal-0.005/META.yml new/Test-Fatal-0.006/META.yml --- old/Test-Fatal-0.005/META.yml 2011-04-26 13:50:56.000000000 +0200 +++ new/Test-Fatal-0.006/META.yml 2011-06-02 04:55:14.000000000 +0200 @@ -3,12 +3,13 @@ author: - 'Ricardo Signes <[email protected]>' build_requires: - Test::More: 0.96 + Test::Builder::Tester: 0 + Test::More: 0.47 overload: 0 configure_requires: - ExtUtils::MakeMaker: 6.31 + ExtUtils::MakeMaker: 6.30 dynamic_config: 0 -generated_by: 'Dist::Zilla version 4.200005, CPAN::Meta::Converter version 2.110930' +generated_by: 'Dist::Zilla version 4.200006, CPAN::Meta::Converter version 2.110930' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -16,101 +17,103 @@ name: Test-Fatal requires: Carp: 0 - Exporter: 5.59 + Exporter: 5.57 + Test::Builder: 0 Try::Tiny: 0.07 resources: - repository: git://git.codesimply.com/Test-Fatal.git -version: 0.005 + homepage: http://github.com/rjbs/test-fatal + repository: http://github.com/rjbs/test-fatal +version: 0.006 x_Dist_Zilla: plugins: - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@RJBS/CheckPrereqsIndexed' - version: 0.002 + version: 0.003 - class: Dist::Zilla::Plugin::GatherDir name: '@RJBS/@Basic/GatherDir' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::PruneCruft name: '@RJBS/@Basic/PruneCruft' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::ManifestSkip name: '@RJBS/@Basic/ManifestSkip' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::MetaYAML name: '@RJBS/@Basic/MetaYAML' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::License name: '@RJBS/@Basic/License' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::Readme name: '@RJBS/@Basic/Readme' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::ExtraTests name: '@RJBS/@Basic/ExtraTests' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::ExecDir name: '@RJBS/@Basic/ExecDir' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::ShareDir name: '@RJBS/@Basic/ShareDir' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::MakeMaker name: '@RJBS/@Basic/MakeMaker' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::Manifest name: '@RJBS/@Basic/Manifest' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::TestRelease name: '@RJBS/@Basic/TestRelease' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RJBS/@Basic/ConfirmRelease' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RJBS/@Basic/UploadToCPAN' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RJBS/AutoPrereqs' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::Git::NextVersion name: '@RJBS/Git::NextVersion' - version: 1.110500 + version: 1.111460 - class: Dist::Zilla::Plugin::PkgVersion name: '@RJBS/PkgVersion' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::MetaConfig name: '@RJBS/MetaConfig' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::MetaJSON name: '@RJBS/MetaJSON' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::NextRelease name: '@RJBS/NextRelease' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RJBS/PodSyntaxTests' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::Repository name: '@RJBS/Repository' @@ -122,45 +125,73 @@ phase: test type: requires name: '@RJBS/TestMoreWithSubtests' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::PodWeaver name: '@RJBS/PodWeaver' version: 3.101641 - + class: Dist::Zilla::Plugin::GithubMeta + name: '@RJBS/GithubMeta' + version: 0.12 + - class: Dist::Zilla::Plugin::Git::Check name: '@RJBS/@Git/Check' - version: 1.110500 + version: 1.111460 - class: Dist::Zilla::Plugin::Git::Commit name: '@RJBS/@Git/Commit' - version: 1.110500 + version: 1.111460 - class: Dist::Zilla::Plugin::Git::Tag name: '@RJBS/@Git/Tag' - version: 1.110500 + version: 1.111460 - class: Dist::Zilla::Plugin::Git::Push name: '@RJBS/@Git/Push' - version: 1.110500 + version: 1.111460 + - + class: Dist::Zilla::Plugin::RemovePrereqs + config: + Dist::Zilla::Plugin::RemovePrereqs: + modules_to_remove: + - Test::More + name: RemovePrereqs + version: 4.200006 + - + class: Dist::Zilla::Plugin::Prereqs + config: + Dist::Zilla::Plugin::Prereqs: + phase: test + type: requires + name: TestRequires + version: 4.200006 - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' - version: 4.200005 + version: 4.200006 + - + class: Dist::Zilla::Plugin::FinderCode + name: ':IncModules' + version: 4.200006 - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' - version: 4.200005 + version: 4.200006 - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' - version: 4.200005 + version: 4.200006 + - + class: Dist::Zilla::Plugin::FinderCode + name: ':MainModule' + version: 4.200006 zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 - version: 4.200005 + version: 4.200006 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Fatal-0.005/Makefile.PL new/Test-Fatal-0.006/Makefile.PL --- old/Test-Fatal-0.005/Makefile.PL 2011-04-26 13:50:56.000000000 +0200 +++ new/Test-Fatal-0.006/Makefile.PL 2011-06-02 04:55:14.000000000 +0200 @@ -4,7 +4,7 @@ -use ExtUtils::MakeMaker 6.31; +use ExtUtils::MakeMaker 6.30; @@ -12,11 +12,12 @@ 'ABSTRACT' => 'incredibly simple helpers for testing code with exceptions', 'AUTHOR' => 'Ricardo Signes <[email protected]>', 'BUILD_REQUIRES' => { - 'Test::More' => '0.96', + 'Test::Builder::Tester' => '0', + 'Test::More' => '0.47', 'overload' => '0' }, 'CONFIGURE_REQUIRES' => { - 'ExtUtils::MakeMaker' => '6.31' + 'ExtUtils::MakeMaker' => '6.30' }, 'DISTNAME' => 'Test-Fatal', 'EXE_FILES' => [], @@ -24,10 +25,11 @@ 'NAME' => 'Test::Fatal', 'PREREQ_PM' => { 'Carp' => '0', - 'Exporter' => '5.59', + 'Exporter' => '5.57', + 'Test::Builder' => '0', 'Try::Tiny' => '0.07' }, - 'VERSION' => '0.005', + 'VERSION' => '0.006', 'test' => { 'TESTS' => 't/*.t' } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Fatal-0.005/README new/Test-Fatal-0.006/README --- old/Test-Fatal-0.005/README 2011-04-26 13:50:56.000000000 +0200 +++ new/Test-Fatal-0.006/README 2011-06-02 04:55:14.000000000 +0200 @@ -1,7 +1,7 @@ This archive contains the distribution Test-Fatal, -version 0.005: +version 0.006: incredibly simple helpers for testing code with exceptions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Fatal-0.005/dist.ini new/Test-Fatal-0.006/dist.ini --- old/Test-Fatal-0.005/dist.ini 2011-04-26 13:50:56.000000000 +0200 +++ new/Test-Fatal-0.006/dist.ini 2011-06-02 04:55:14.000000000 +0200 @@ -4,5 +4,10 @@ copyright_holder = Ricardo Signes copyright_year = 2010 - [@RJBS] + +[RemovePrereqs] +remove = Test::More + +[Prereqs / TestRequires] +Test::More = 0.47 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Fatal-0.005/lib/Test/Fatal.pm new/Test-Fatal-0.006/lib/Test/Fatal.pm --- old/Test-Fatal-0.005/lib/Test/Fatal.pm 2011-04-26 13:50:56.000000000 +0200 +++ new/Test-Fatal-0.006/lib/Test/Fatal.pm 2011-06-02 04:55:14.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package Test::Fatal; BEGIN { - $Test::Fatal::VERSION = '0.005'; + $Test::Fatal::VERSION = '0.006'; } # ABSTRACT: incredibly simple helpers for testing code with exceptions @@ -10,10 +10,10 @@ use Carp (); use Try::Tiny 0.07; -use Exporter 5.59 'import'; +use Exporter 5.57 'import'; our @EXPORT = qw(exception); -our @EXPORT_OK = qw(exception success); +our @EXPORT_OK = qw(exception success dies_ok lives_ok); sub exception (&;@) { @@ -39,6 +39,34 @@ }, @_ ); } + +my $Tester; + +# Signature should match that of Test::Exception +sub dies_ok (&;$) { + my $code = shift; + my $name = shift; + + require Test::Builder; + $Tester ||= Test::Builder->new; + + my $ok = $Tester->ok( exception( \&$code ), $name ); + $ok or $Tester->diag( "expected an exception but none was raised" ); + return $ok; +} + +sub lives_ok (&;$) { + my $code = shift; + my $name = shift; + + require Test::Builder; + $Tester ||= Test::Builder->new; + + my $ok = $Tester->ok( !exception( \&$code ), $name ); + $ok or $Tester->diag( "expected return but an exception was raised" ); + return $ok; +} + 1; __END__ @@ -50,7 +78,7 @@ =head1 VERSION -version 0.005 +version 0.006 =head1 SYNOPSIS @@ -61,7 +89,7 @@ is( exception { might_die; }, - undef + undef, "the code lived", ); @@ -103,7 +131,8 @@ Note that there is no TAP assert being performed. In other words, no "ok" or "not ok" line is emitted. It's up to you to use the rest of C<exception> in an -existing test like C<ok>, C<isa_ok>, C<is>, et cetera. +existing test like C<ok>, C<isa_ok>, C<is>, et cetera. Or you may wish to use +the C<dies_ok> and C<lives_ok> wrappers, which do provide TAP output. C<exception> does I<not> alter the stack presented to the called block, meaning that if the exception returned has a stack trace, it will include some frames @@ -111,6 +140,17 @@ This is considered a I<feature> because it avoids the occasionally twitchy C<Sub::Uplevel> mechanism. +B<Achtung!> This is not a great idea: + + like( exception { ... }, qr/foo/, "foo appears in the exception" ); + +If the code in the C<...> is going to throw a stack trace with the arguments to +each subroutine in its call stack, the test name, "foo appears in the +exception" will itself be matched by the regex. Instead, write this: + + my $exception = exception { ... }; + like( $exception, qr/foo/, "foo appears in the exception" ); + =head2 success try { @@ -128,6 +168,25 @@ Although almost any needed exception tests can be performed with C<exception>, success blocks may sometimes help organize complex testing. +=head2 dies_ok + +=head2 lives_ok + +Exported only by request, these two functions run a given block of code, and +provide TAP output indicating if it did, or did not throw an exception. +These provide an easy upgrade path for replacing existing unit tests based on +C<Test::Exception>. + +RJBS does not using this except as a convenience while porting tests to use +Test::Fatal's C<exception> routine. + + use Test::More tests => 2; + use Test::Fatal qw(dies_ok lives_ok); + + dies_ok { die "I failed" } 'code that fails'; + + lives_ok { return "I'm still alive" } 'code that does not fail'; + =head1 AUTHOR Ricardo Signes <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Fatal-0.005/t/like-exception.t new/Test-Fatal-0.006/t/like-exception.t --- old/Test-Fatal-0.005/t/like-exception.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-Fatal-0.006/t/like-exception.t 2011-06-02 04:55:14.000000000 +0200 @@ -0,0 +1,27 @@ +#!/usr/bin/perl + +use strict; + +use Test::Builder::Tester tests => 4; + +use Test::Fatal qw( dies_ok lives_ok ); + +test_out( "ok 1 - died" ); +dies_ok { die "FAIL" } 'died'; +test_test( "die dies" ); + +test_out( "not ok 1 - returned" ); +test_fail( +2 ); +test_err( "# expected an exception but none was raised" ); +dies_ok { return 1 } 'returned'; +test_test( "return doesn't die" ); + +test_out( "ok 1 - returned" ); +lives_ok { return 1 } 'returned'; +test_test( "return lived" ); + +test_out( "not ok 1 - died" ); +test_fail( +2 ); +test_err( "# expected return but an exception was raised" ); +lives_ok { die "FAIL" } 'died'; +test_test( "die doesn't live" ); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
