Hello community, here is the log from the commit of package perl-Test-Exception for openSUSE:Factory checked in at 2015-04-16 14:11:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Test-Exception (Old) and /work/SRC/openSUSE:Factory/.perl-Test-Exception.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-Exception" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Test-Exception/perl-Test-Exception.changes 2015-02-11 16:32:01.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Test-Exception.new/perl-Test-Exception.changes 2015-04-16 14:11:49.000000000 +0200 @@ -1,0 +2,12 @@ +Mon Apr 13 18:27:40 UTC 2015 - co...@suse.com + +- updated to 0.38 + see /usr/share/doc/packages/perl-Test-Exception/Changes + + 0.38 [2015-02-27] + - fixed repository link in metadata + + 0.37 [2015-02-27] + - distribution is now managed by ExtUtils::MakeMaker (RT#102054) + +------------------------------------------------------------------- Old: ---- Test-Exception-0.36.tar.gz New: ---- Test-Exception-0.38.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Test-Exception.spec ++++++ --- /var/tmp/diff_new_pack.JhsPI9/_old 2015-04-16 14:11:50.000000000 +0200 +++ /var/tmp/diff_new_pack.JhsPI9/_new 2015-04-16 14:11:50.000000000 +0200 @@ -17,29 +17,25 @@ Name: perl-Test-Exception -Version: 0.36 +Version: 0.38 Release: 0 %define cpan_name Test-Exception Summary: Test exception based code License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Test-Exception/ -Source: http://www.cpan.org/authors/id/E/EX/EXODIST/%{cpan_name}-%{version}.tar.gz +Source: http://www.cpan.org/authors/id/E/ET/ETHER/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros -BuildRequires: perl(Module::Build) >= 0.42 BuildRequires: perl(Sub::Uplevel) >= 0.18 BuildRequires: perl(Test::Builder) >= 0.7 BuildRequires: perl(Test::Builder::Tester) >= 1.07 BuildRequires: perl(Test::More) >= 0.7 -BuildRequires: perl(Test::Simple) >= 0.7 Requires: perl(Sub::Uplevel) >= 0.18 Requires: perl(Test::Builder) >= 0.7 Requires: perl(Test::Builder::Tester) >= 1.07 -Requires: perl(Test::More) >= 0.7 -Requires: perl(Test::Simple) >= 0.7 %{perl_requires} %description @@ -53,23 +49,171 @@ You can specify the test plan when you 'use Test::Exception' in the same way as 'use Test::More'. See the Test::More manpage for details. +NOTE: Test::Exception only checks for exceptions. It will ignore other +methods of stopping program execution - including exit(). If you have an +exit() in evalled code Test::Exception will not catch this with any of its +testing functions. + +* *throws_ok* + + Tests to see that a specific exception is thrown. throws_ok() has two + forms: + + throws_ok BLOCK REGEX, TEST_DESCRIPTION + throws_ok BLOCK CLASS, TEST_DESCRIPTION + + In the first form the test passes if the stringified exception matches + the give regular expression. For example: + + throws_ok { read_file( 'unreadable' ) } qr/No file/, 'no file'; + + If your perl does not support 'qr//' you can also pass a regex-like + string, for example: + + throws_ok { read_file( 'unreadable' ) } '/No file/', 'no file'; + + The second form of throws_ok() test passes if the exception is of the + same class as the one supplied, or a subclass of that class. For example: + + throws_ok { $foo->bar } "Error::Simple", 'simple error'; + + Will only pass if the 'bar' method throws an Error::Simple exception, or + a subclass of an Error::Simple exception. + + You can get the same effect by passing an instance of the exception you + want to look for. The following is equivalent to the previous example: + + my $SIMPLE = Error::Simple->new; + throws_ok { $foo->bar } $SIMPLE, 'simple error'; + + Should a throws_ok() test fail it produces appropriate diagnostic + messages. For example: + + not ok 3 - simple error + # Failed test (test.t at line 48) + # expecting: Error::Simple exception + # found: normal exit + + Like all other Test::Exception functions you can avoid prototypes by + passing a subroutine explicitly: + + throws_ok( sub {$foo->bar}, "Error::Simple", 'simple error' ); + + A true value is returned if the test succeeds, false otherwise. On exit + $@ is guaranteed to be the cause of death (if any). + + A description of the exception being checked is used if no optional test + description is passed. + + NOTE: Remember when you 'die $string_without_a_trailing_newline' perl + will automatically add the current script line number, input line number + and a newline. This will form part of the string that throws_ok regular + expressions match against. + +* *dies_ok* + + Checks that a piece of code dies, rather than returning normally. For + example: + + sub div { + my ( $a, $b ) = @_; + return $a / $b; + }; + + dies_ok { div( 1, 0 ) } 'divide by zero detected'; + + # or if you don't like prototypes + dies_ok( sub { div( 1, 0 ) }, 'divide by zero detected' ); + + A true value is returned if the test succeeds, false otherwise. On exit + $@ is guaranteed to be the cause of death (if any). + + Remember: This test will pass if the code dies for any reason. If you + care about the reason it might be more sensible to write a more specific + test using throws_ok(). + + The test description is optional, but recommended. + +* *lives_ok* + + Checks that a piece of code doesn't die. This allows your test script to + continue, rather than aborting if you get an unexpected exception. For + example: + + sub read_file { + my $file = shift; + local $/; + open my $fh, '<', $file or die "open failed ($!)\n"; + $file = <FILE>; + return $file; + }; + + my $file; + lives_ok { $file = read_file('test.txt') } 'file read'; + + # or if you don't like prototypes + lives_ok( sub { $file = read_file('test.txt') }, 'file read' ); + + Should a lives_ok() test fail it produces appropriate diagnostic + messages. For example: + + not ok 1 - file read + # Failed test (test.t at line 15) + # died: open failed (No such file or directory) + + A true value is returned if the test succeeds, false otherwise. On exit + $@ is guaranteed to be the cause of death (if any). + + The test description is optional, but recommended. + +* *lives_and* + + Run a test that may throw an exception. For example, instead of doing: + + my $file; + lives_ok { $file = read_file('answer.txt') } 'read_file worked'; + is $file, "42", 'answer was 42'; + + You can use lives_and() like this: + + lives_and { is read_file('answer.txt'), "42" } 'answer is 42'; + # or if you don't like prototypes + lives_and(sub {is read_file('answer.txt'), "42"}, 'answer is 42'); + + Which is the same as doing + + is read_file('answer.txt'), "42\n", 'answer is 42'; + + unless 'read_file('answer.txt')' dies, in which case you get the same + kind of error as lives_ok() + + not ok 1 - answer is 42 + # Failed test (test.t at line 15) + # died: open failed (No such file or directory) + + A true value is returned if the test succeeds, false otherwise. On exit + $@ is guaranteed to be the cause of death (if any). + + The test description is optional, but recommended. + %prep %setup -q -n %{cpan_name}-%{version} find . -type f -print0 | xargs -0 chmod 644 %build -%{__perl} Build.PL installdirs=vendor -./Build build flags=%{?_smp_mflags} +%{__perl} Makefile.PL INSTALLDIRS=vendor +%{__make} %{?_smp_mflags} %check -./Build test +%{__make} test %install -./Build install destdir=%{buildroot} create_packlist=0 +%perl_make_install +%perl_process_packlist %perl_gen_filelist %files -f %{name}.files %defattr(-,root,root,755) -%doc Changes README xt +%doc Changes %changelog ++++++ Test-Exception-0.36.tar.gz -> Test-Exception-0.38.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/Build.PL new/Test-Exception-0.38/Build.PL --- old/Test-Exception-0.36/Build.PL 2015-01-08 17:50:39.000000000 +0100 +++ new/Test-Exception-0.38/Build.PL 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -use Module::Build; - -my $build = Module::Build->new( - module_name => 'Test::Exception', - license => 'perl', - requires => { - # 'perl' => '5.6.1', - 'Test::Simple' => '0.7', - 'Test::Builder' => '0.7', - 'Test::Builder::Tester' => '1.07', - 'Test::More' => '0.7', - 'Test::Harness' => '2.03', - 'Sub::Uplevel' => '0.18', - }, - create_makefile_pl => 'traditional', - create_readme => 1, -); -$build->create_build_script; - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/Changes new/Test-Exception-0.38/Changes --- old/Test-Exception-0.36/Changes 2015-01-08 17:50:39.000000000 +0100 +++ new/Test-Exception-0.38/Changes 2015-02-28 04:35:36.000000000 +0100 @@ -1,5 +1,11 @@ Revision history for Perl extension Test::Exception: +0.38 [2015-02-27] + - fixed repository link in metadata + +0.37 [2015-02-27] + - distribution is now managed by ExtUtils::MakeMaker (RT#102054) + 0.36 [2015-01-08] - Fix bug when Test::More has been downgraded diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/MANIFEST new/Test-Exception-0.38/MANIFEST --- old/Test-Exception-0.36/MANIFEST 2015-01-08 17:50:39.000000000 +0100 +++ new/Test-Exception-0.38/MANIFEST 2015-02-28 04:37:14.000000000 +0100 @@ -1,7 +1,8 @@ -Build.PL Changes lib/Test/Exception.pm +Makefile.PL MANIFEST This list of files +MANIFEST.SKIP t/caller.t t/edge-cases.t t/Exception.t @@ -13,12 +14,11 @@ t/rt.t t/stacktrace.t t/throws_ok.t +xt/distmanifest.t xt/documented.t xt/perlcritic.t xt/perlcriticrc xt/pod.t xt/spelling.t -Makefile.PL -README -META.yml -META.json +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/MANIFEST.SKIP new/Test-Exception-0.38/MANIFEST.SKIP --- old/Test-Exception-0.36/MANIFEST.SKIP 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-Exception-0.38/MANIFEST.SKIP 2015-02-28 04:37:10.000000000 +0100 @@ -0,0 +1,72 @@ + +#!start included /Volumes/amaretto/Users/ether/.perlbrew/libs/21.6@std/lib/perl5/ExtUtils/MANIFEST.SKIP +# Avoid version control files. +\bRCS\b +\bCVS\b +\bSCCS\b +,v$ +\B\.svn\b +\B\.git\b +\B\.gitignore\b +\b_darcs\b +\B\.cvsignore$ + +# Avoid VMS specific MakeMaker generated files +\bDescrip.MMS$ +\bDESCRIP.MMS$ +\bdescrip.mms$ + +# Avoid Makemaker generated and utility files. +\bMANIFEST\.bak +\bMakefile$ +\bblib/ +\bMakeMaker-\d +\bpm_to_blib\.ts$ +\bpm_to_blib$ +\bblibdirs\.ts$ # 6.18 through 6.25 generated this +\b_eumm/ # 7.05_05 and above + +# Avoid Module::Build generated and utility files. +\bBuild$ +\b_build/ +\bBuild.bat$ +\bBuild.COM$ +\bBUILD.COM$ +\bbuild.com$ + +# and Module::Build::Tiny generated files +\b_build_params$ + +# Avoid temp and backup files. +~$ +\.old$ +\#$ +\b\.# +\.bak$ +\.tmp$ +\.# +\.rej$ +\..*\.sw.?$ + +# Avoid OS-specific files/dirs +# Mac OSX metadata +\B\.DS_Store +# Mac OSX SMB mount metadata files +\B\._ + +# Avoid Devel::Cover and Devel::CoverX::Covered files. +\bcover_db\b +\bcovered\b + +# Avoid prove files +\B\.prove$ + +# Avoid MYMETA files +^MYMETA\. +#!end included /Volumes/amaretto/Users/ether/.perlbrew/libs/21.6@std/lib/perl5/ExtUtils/MANIFEST.SKIP + + +.ackrc +Test-Exception-.*/ +Test-Exception-.*.tar.gz +todo.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/META.json new/Test-Exception-0.38/META.json --- old/Test-Exception-0.36/META.json 2015-01-08 17:50:39.000000000 +0100 +++ new/Test-Exception-0.38/META.json 2015-02-28 04:37:14.000000000 +0100 @@ -3,8 +3,8 @@ "author" : [ "Adrian Howard <adri...@quietstars.com>" ], - "dynamic_config" : 1, - "generated_by" : "Module::Build version 0.421", + "dynamic_config" : 0, + "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.143240", "license" : [ "perl_5" ], @@ -13,34 +13,53 @@ "version" : "2" }, "name" : "Test-Exception", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, "prereqs" : { "configure" : { "requires" : { - "Module::Build" : "0.42" + "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { + "Carp" : "0", + "Exporter" : "0", "Sub::Uplevel" : "0.18", "Test::Builder" : "0.7", "Test::Builder::Tester" : "1.07", "Test::Harness" : "2.03", + "base" : "0", + "perl" : "5.006001", + "strict" : "0", + "warnings" : "0" + } + }, + "test" : { + "requires" : { "Test::More" : "0.7", - "Test::Simple" : "0.7" + "overload" : "0" } } }, - "provides" : { - "Test::Exception" : { - "file" : "lib/Test/Exception.pm", - "version" : "0.36" - } - }, "release_status" : "stable", "resources" : { - "license" : [ - "http://dev.perl.org/licenses/" - ] + "bugtracker" : { + "mailto" : "bug-test-except...@rt.cpan.org", + "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Exception" + }, + "homepage" : "https://github.com/Test-More/test-exception", + "repository" : { + "type" : "git", + "url" : "https://github.com/Test-More/test-exception.git", + "web" : "https://github.com/Test-More/test-exception" + } }, - "version" : "0.36" + "version" : "0.38", + "x_IRC" : "irc://irc.perl.org/#perl-qa", + "x_MailingList" : "http://lists.perl.org/list/perl-qa.html" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/META.yml new/Test-Exception-0.38/META.yml --- old/Test-Exception-0.36/META.yml 2015-01-08 17:50:39.000000000 +0100 +++ new/Test-Exception-0.38/META.yml 2015-02-28 04:37:14.000000000 +0100 @@ -2,27 +2,37 @@ abstract: 'Test exception based code' author: - 'Adrian Howard <adri...@quietstars.com>' -build_requires: {} +build_requires: + Test::More: '0.7' + overload: '0' configure_requires: - Module::Build: '0.42' -dynamic_config: 1 -generated_by: 'Module::Build version 0.421, CPAN::Meta::Converter version 2.142060' + ExtUtils::MakeMaker: '0' +dynamic_config: 0 +generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.143240' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Test-Exception -provides: - Test::Exception: - file: lib/Test/Exception.pm - version: '0.36' +no_index: + directory: + - t + - inc requires: + Carp: '0' + Exporter: '0' Sub::Uplevel: '0.18' Test::Builder: '0.7' Test::Builder::Tester: '1.07' Test::Harness: '2.03' - Test::More: '0.7' - Test::Simple: '0.7' + base: '0' + perl: '5.006001' + strict: '0' + warnings: '0' resources: - license: http://dev.perl.org/licenses/ -version: '0.36' + bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Exception + homepage: https://github.com/Test-More/test-exception + repository: https://github.com/Test-More/test-exception.git +version: '0.38' +x_IRC: irc://irc.perl.org/#perl-qa +x_MailingList: http://lists.perl.org/list/perl-qa.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/Makefile.PL new/Test-Exception-0.38/Makefile.PL --- old/Test-Exception-0.36/Makefile.PL 2015-01-08 17:50:39.000000000 +0100 +++ new/Test-Exception-0.38/Makefile.PL 2015-02-28 04:33:54.000000000 +0100 @@ -1,19 +1,105 @@ -# Note: this file was auto-generated by Module::Build::Compat version 0.4210 +use strict; +use warnings; + use ExtUtils::MakeMaker; -WriteMakefile -( - 'NAME' => 'Test::Exception', - 'VERSION_FROM' => 'lib/Test/Exception.pm', - 'PREREQ_PM' => { - 'Sub::Uplevel' => '0.18', - 'Test::Builder' => '0.7', - 'Test::Builder::Tester' => '1.07', - 'Test::Harness' => '2.03', - 'Test::More' => '0.7', - 'Test::Simple' => '0.7' - }, - 'INSTALLDIRS' => 'site', - 'EXE_FILES' => [], - 'PL_FILES' => {} -) -; + +my %WriteMakefileArgs = ( + NAME => 'Test::Exception', + AUTHOR => 'Adrian Howard <adri...@quietstars.com>', + LICENSE => 'perl_5', + ABSTRACT_FROM => 'lib/Test/Exception.pm', + VERSION_FROM => 'lib/Test/Exception.pm', + + META_MERGE => { + 'meta-spec' => { version => 2 }, + dynamic_config => 0, + resources => { + homepage => 'https://github.com/Test-More/test-exception', + repository => { + url => 'https://github.com/Test-More/test-exception.git', + web => 'https://github.com/Test-More/test-exception', + type => 'git', + }, + bugtracker => { + mailto => 'bug-test-except...@rt.cpan.org', + web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Exception', + }, + }, + x_IRC => 'irc://irc.perl.org/#perl-qa', + x_MailingList => 'http://lists.perl.org/list/perl-qa.html', + }, + + META_ADD => { + prereqs => { + configure => { + requires => { + 'ExtUtils::MakeMaker' => '0', + }, + }, + runtime => { + requires => { + 'Carp' => '0', + 'Exporter' => '0', + 'base' => '0', + 'strict' => '0', + 'warnings' => '0', + 'Test::Builder' => '0.7', + 'Test::Builder::Tester' => '1.07', + 'Test::Harness' => '2.03', + 'Sub::Uplevel' => '0.18', + 'perl' => '5.006001', + }, + }, + test => { + requires => { + 'Test::More' => '0.7', + 'overload' => '0', + }, + }, + }, + }, +); + +my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; + +for (qw(configure build test runtime)) { + my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES'; + next unless exists $WriteMakefileArgs{META_ADD}{prereqs}{$_} + or exists $WriteMakefileArgs{$key}; + my $r = $WriteMakefileArgs{$key} = { + %{$WriteMakefileArgs{META_ADD}{prereqs}{$_}{requires} || {}}, + %{delete $WriteMakefileArgs{$key} || {}}, + }; + defined $r->{$_} or delete $r->{$_} for keys %$r; +} + +# dynamic prereqs get added here. + +$WriteMakefileArgs{MIN_PERL_VERSION} = delete $WriteMakefileArgs{PREREQ_PM}{perl} || 0; + +die 'attention developer: you need to do a sane meta merge here!' + if keys %{$WriteMakefileArgs{BUILD_REQUIRES}}; + +$WriteMakefileArgs{BUILD_REQUIRES} = { + %{$WriteMakefileArgs{BUILD_REQUIRES} || {}}, + %{delete $WriteMakefileArgs{TEST_REQUIRES}} +} if $eumm_version < 6.63_03; + +$WriteMakefileArgs{PREREQ_PM} = { + %{$WriteMakefileArgs{PREREQ_PM}}, + %{delete $WriteMakefileArgs{BUILD_REQUIRES}} +} if $eumm_version < 6.55_01; + +delete $WriteMakefileArgs{CONFIGURE_REQUIRES} + if $eumm_version < 6.51_03; + +delete $WriteMakefileArgs{MIN_PERL_VERSION} + if $eumm_version < 6.48; + +delete @WriteMakefileArgs{qw(META_ADD META_MERGE)} + if $eumm_version < 6.46; + +delete $WriteMakefileArgs{LICENSE} + if $eumm_version < 6.31; + +WriteMakefile(%WriteMakefileArgs); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/README new/Test-Exception-0.38/README --- old/Test-Exception-0.36/README 2015-01-08 17:50:39.000000000 +0100 +++ new/Test-Exception-0.38/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,305 +0,0 @@ -NAME - Test::Exception - Test exception based code - -SYNOPSIS - use Test::More tests => 5; - use Test::Exception; - - # or if you don't need Test::More - - use Test::Exception tests => 5; - - # then... - - # Check that the stringified exception matches given regex - throws_ok { $foo->method } qr/division by zero/, 'zero caught okay'; - - # Check an exception of the given class (or subclass) is thrown - throws_ok { $foo->method } 'Error::Simple', 'simple error thrown'; - - # all Test::Exceptions subroutines are guaranteed to preserve the state - # of $@ so you can do things like this after throws_ok and dies_ok - like $@, 'what the stringified exception should look like'; - - # Check that something died - we do not care why - dies_ok { $foo->method } 'expecting to die'; - - # Check that something did not die - lives_ok { $foo->method } 'expecting to live'; - - # Check that a test runs without an exception - lives_and { is $foo->method, 42 } 'method is 42'; - - # or if you don't like prototyped functions - - throws_ok( sub { $foo->method }, qr/division by zero/, - 'zero caught okay' ); - throws_ok( sub { $foo->method }, 'Error::Simple', - 'simple error thrown' ); - dies_ok( sub { $foo->method }, 'expecting to die' ); - lives_ok( sub { $foo->method }, 'expecting to live' ); - lives_and( sub { is $foo->method, 42 }, 'method is 42' ); - -DESCRIPTION - This module provides a few convenience methods for testing exception - based code. It is built with Test::Builder and plays happily with - Test::More and friends. - - If you are not already familiar with Test::More now would be the time to - go take a look. - - You can specify the test plan when you "use Test::Exception" in the same - way as "use Test::More". See Test::More for details. - - NOTE: Test::Exception only checks for exceptions. It will ignore other - methods of stopping program execution - including exit(). If you have an - exit() in evalled code Test::Exception will not catch this with any of - its testing functions. - - throws_ok - Tests to see that a specific exception is thrown. throws_ok() has - two forms: - - throws_ok BLOCK REGEX, TEST_DESCRIPTION - throws_ok BLOCK CLASS, TEST_DESCRIPTION - - In the first form the test passes if the stringified exception - matches the give regular expression. For example: - - throws_ok { read_file( 'unreadable' ) } qr/No file/, 'no file'; - - If your perl does not support "qr//" you can also pass a regex-like - string, for example: - - throws_ok { read_file( 'unreadable' ) } '/No file/', 'no file'; - - The second form of throws_ok() test passes if the exception is of - the same class as the one supplied, or a subclass of that class. For - example: - - throws_ok { $foo->bar } "Error::Simple", 'simple error'; - - Will only pass if the "bar" method throws an Error::Simple - exception, or a subclass of an Error::Simple exception. - - You can get the same effect by passing an instance of the exception - you want to look for. The following is equivalent to the previous - example: - - my $SIMPLE = Error::Simple->new; - throws_ok { $foo->bar } $SIMPLE, 'simple error'; - - Should a throws_ok() test fail it produces appropriate diagnostic - messages. For example: - - not ok 3 - simple error - # Failed test (test.t at line 48) - # expecting: Error::Simple exception - # found: normal exit - - Like all other Test::Exception functions you can avoid prototypes by - passing a subroutine explicitly: - - throws_ok( sub {$foo->bar}, "Error::Simple", 'simple error' ); - - A true value is returned if the test succeeds, false otherwise. On - exit $@ is guaranteed to be the cause of death (if any). - - A description of the exception being checked is used if no optional - test description is passed. - - NOTE: Rememeber when you "die $string_without_a_trailing_newline" - perl will automatically add the current script line number, input - line number and a newline. This will form part of the string that - throws_ok regular expressions match against. - - dies_ok - Checks that a piece of code dies, rather than returning normally. - For example: - - sub div { - my ( $a, $b ) = @_; - return $a / $b; - }; - - dies_ok { div( 1, 0 ) } 'divide by zero detected'; - - # or if you don't like prototypes - dies_ok( sub { div( 1, 0 ) }, 'divide by zero detected' ); - - A true value is returned if the test succeeds, false otherwise. On - exit $@ is guaranteed to be the cause of death (if any). - - Remember: This test will pass if the code dies for any reason. If - you care about the reason it might be more sensible to write a more - specific test using throws_ok(). - - The test description is optional, but recommended. - - lives_ok - Checks that a piece of code doesn't die. This allows your test - script to continue, rather than aborting if you get an unexpected - exception. For example: - - sub read_file { - my $file = shift; - local $/; - open my $fh, '<', $file or die "open failed ($!)\n"; - $file = <FILE>; - return $file; - }; - - my $file; - lives_ok { $file = read_file('test.txt') } 'file read'; - - # or if you don't like prototypes - lives_ok( sub { $file = read_file('test.txt') }, 'file read' ); - - Should a lives_ok() test fail it produces appropriate diagnostic - messages. For example: - - not ok 1 - file read - # Failed test (test.t at line 15) - # died: open failed (No such file or directory) - - A true value is returned if the test succeeds, false otherwise. On - exit $@ is guaranteed to be the cause of death (if any). - - The test description is optional, but recommended. - - lives_and - Run a test that may throw an exception. For example, instead of - doing: - - my $file; - lives_ok { $file = read_file('answer.txt') } 'read_file worked'; - is $file, "42", 'answer was 42'; - - You can use lives_and() like this: - - lives_and { is read_file('answer.txt'), "42" } 'answer is 42'; - # or if you don't like prototypes - lives_and(sub {is read_file('answer.txt'), "42"}, 'answer is 42'); - - Which is the same as doing - - is read_file('answer.txt'), "42\n", 'answer is 42'; - - unless "read_file('answer.txt')" dies, in which case you get the - same kind of error as lives_ok() - - not ok 1 - answer is 42 - # Failed test (test.t at line 15) - # died: open failed (No such file or directory) - - A true value is returned if the test succeeds, false otherwise. On - exit $@ is guaranteed to be the cause of death (if any). - - The test description is optional, but recommended. - -SKIPPING TEST::EXCEPTION TESTS - Sometimes we want to use Test::Exception tests in a test suite, but - don't want to force the user to have Test::Exception installed. One way - to do this is to skip the tests if Test::Exception is absent. You can do - this with code something like this: - - use strict; - use warnings; - use Test::More; - - BEGIN { - eval "use Test::Exception"; - plan skip_all => "Test::Exception needed" if $@; - } - - plan tests => 2; - # ... tests that need Test::Exception ... - - Note that we load Test::Exception in a "BEGIN" block ensuring that the - subroutine prototypes are in place before the rest of the test script is - compiled. - -BUGS - There are some edge cases in Perl's exception handling where - Test::Exception will miss exceptions thrown in DESTROY blocks. See the - RT bug <http://rt.cpan.org/Ticket/Display.html?id=24678> for details, - along with the t/edge-cases.t in the distribution test suite. These will - be addressed in a future Test::Exception release. - - If you find any more bugs please let me know by e-mail, or report the - problem with <http://rt.cpan.org/>. - -COMMUNITY - perl-qa - If you are interested in testing using Perl I recommend you visit - <http://qa.perl.org/> and join the excellent perl-qa mailing list. - See <http://lists.perl.org/showlist.cgi?name=perl-qa> for details on - how to subscribe. - - perlmonks - You can find users of Test::Exception, including the module author, - on <http://www.perlmonks.org/>. Feel free to ask questions on - Test::Exception there. - - CPAN::Forum - The CPAN Forum is a web forum for discussing Perl's CPAN modules. - The Test::Exception forum can be found at - <http://www.cpanforum.com/dist/Test-Exception>. - - AnnoCPAN - AnnoCPAN is a web site that allows community annotations of Perl - module documentation. The Test::Exception annotations can be found - at <http://annocpan.org/~ADIE/Test-Exception/>. - -TO DO - If you think this module should do something that it doesn't (or does - something that it shouldn't) please let me know. - - You can see my current to do list at - <http://adrianh.tadalist.com/lists/public/15421>, with an RSS feed of - changes at <http://adrianh.tadalist.com/lists/feed_public/15421>. - -ACKNOWLEDGMENTS - Thanks to chromatic and Michael G Schwern for the excellent - Test::Builder, without which this module wouldn't be possible. - - Thanks to Adam Kennedy, Andy Lester, Aristotle Pagaltzis, Ben Prew, Cees - Hek, Chris Dolan, chromatic, Curt Sampson, David Cantrell, David Golden, - David Tulloh, David Wheeler, J. K. O'Brien, Janek Schleicher, Jim - Keenan, Jos I. Boumans, Joshua ben Jore, Jost Krieger, Mark Fowler, - Michael G Schwern, Nadim Khemir, Paul McCann, Perrin Harkins, Peter - Rabbitson, Peter Scott, Ricardo Signes, Rob Muhlestein, Scott R. Godin, - Steve Purkis, Steve, Tim Bunce, and various anonymous folk for comments, - suggestions, bug reports and patches. - -AUTHOR - Adrian Howard <adri...@quietstars.com> - - If you can spare the time, please drop me a line if you find this module - useful. - -SEE ALSO - <http://del.icio.us/tag/Test::Exception> - Delicious links on Test::Exception. - - Test::Warn & Test::NoWarnings - Modules to help test warnings. - - Test::Builder - Support module for building test libraries. - - Test::Simple & Test::More - Basic utilities for writing tests. - - <http://qa.perl.org/test-modules.html> - Overview of some of the many testing modules available on CPAN. - - <http://del.icio.us/tag/perl+testing> - Delicious links on perl testing. - -LICENCE - Copyright 2002-2007 Adrian Howard, All Rights Reserved. - - This program is free software; you can redistribute it and/or modify it - under the same terms as Perl itself. - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/lib/Test/Exception.pm new/Test-Exception-0.38/lib/Test/Exception.pm --- old/Test-Exception-0.36/lib/Test/Exception.pm 2015-01-08 17:50:39.000000000 +0100 +++ new/Test-Exception-0.38/lib/Test/Exception.pm 2015-02-28 04:35:36.000000000 +0100 @@ -6,7 +6,7 @@ use Sub::Uplevel qw( uplevel ); use base qw( Exporter ); -our $VERSION = '0.36'; +our $VERSION = '0.38'; our @EXPORT = qw(dies_ok lives_ok throws_ok lives_and); my $Tester = Test::Builder->new; @@ -198,7 +198,7 @@ A description of the exception being checked is used if no optional test description is passed. -NOTE: Rememeber when you C<die $string_without_a_trailing_newline> perl will +NOTE: Remember when you C<die $string_without_a_trailing_newline> perl will automatically add the current script line number, input line number and a newline. This will form part of the string that throws_ok regular expressions match against. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/xt/distmanifest.t new/Test-Exception-0.38/xt/distmanifest.t --- old/Test-Exception-0.36/xt/distmanifest.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-Exception-0.38/xt/distmanifest.t 2015-02-28 04:21:31.000000000 +0100 @@ -0,0 +1,5 @@ +use strict; +use warnings; + +use Test::DistManifest; +manifest_ok(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/xt/documented.t new/Test-Exception-0.38/xt/documented.t --- old/Test-Exception-0.36/xt/documented.t 2015-01-08 17:50:39.000000000 +0100 +++ new/Test-Exception-0.38/xt/documented.t 2015-02-28 04:25:08.000000000 +0100 @@ -1,9 +1,7 @@ -#! /usr/bin/perl -Tw - use strict; use warnings; use Test::More; eval "use Test::Pod::Coverage 1.00"; plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@; -all_pod_coverage_ok(); \ No newline at end of file +all_pod_coverage_ok(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/xt/perlcritic.t new/Test-Exception-0.38/xt/perlcritic.t --- old/Test-Exception-0.36/xt/perlcritic.t 2015-01-08 17:50:39.000000000 +0100 +++ new/Test-Exception-0.38/xt/perlcritic.t 2015-02-28 04:25:08.000000000 +0100 @@ -1,5 +1,3 @@ -#! /usr/bin/perl -Tw - use strict; use warnings; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/xt/pod.t new/Test-Exception-0.38/xt/pod.t --- old/Test-Exception-0.36/xt/pod.t 2015-01-08 17:50:39.000000000 +0100 +++ new/Test-Exception-0.38/xt/pod.t 2015-02-28 04:25:08.000000000 +0100 @@ -1,5 +1,3 @@ -#! /usr/bin/perl -Tw - use strict; use warnings; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Exception-0.36/xt/spelling.t new/Test-Exception-0.38/xt/spelling.t --- old/Test-Exception-0.36/xt/spelling.t 2015-01-08 17:50:39.000000000 +0100 +++ new/Test-Exception-0.38/xt/spelling.t 2015-02-28 04:25:08.000000000 +0100 @@ -1,16 +1,9 @@ -#!/usr/bin/perl - use strict; use warnings; use Test::More; +use Test::Spelling; +use Pod::Wordlist; -my $ispell_path = eval q{ - use Test::Spelling; - use File::Which; - which('ispell') || die 'no ispell' -}; -plan skip_all => 'Optional Test::Spelling, File::Which and ispell program required to spellcheck POD' if $@; -set_spell_cmd("$ispell_path -l"); add_stopwords( <DATA> ); all_pod_files_spelling_ok(); @@ -47,3 +40,6 @@ RT Ricardo Signes +Rabbitson +Schwern +Tulloh