[libmoosex-lazyrequire-perl] 01/08: convert tests to Test::Fatal
Intrigeri
intrigeri at moszumanska.debian.org
Wed Aug 27 21:25:21 UTC 2014
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to annotated tag v0.08
in repository libmoosex-lazyrequire-perl.
commit edc93c3841e8fcf60765184a2b0ee2a2d020d526
Author: Karen Etheridge <ether at cpan.org>
Date: Sat Jun 30 21:33:24 2012 -0700
convert tests to Test::Fatal
---
Changes | 2 ++
t/basic.t | 51 +++++++++++++++++++++++++++++----------------------
2 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/Changes b/Changes
index 44a306d..3f3222c 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+ * Convert uses of Test::Exception to Test::Fatal
+
0.07 Mon, 04 Apr 2011 18:08:34 +0200
* Allow this module to be used with attributes in roles when using Moose
1.9900+ (Dave Rolsky).
diff --git a/t/basic.t b/t/basic.t
index 7947040..dd52535 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
use Test::More 0.88;
-use Test::Exception;
+use Test::Fatal;
{
package Foo;
@@ -23,23 +23,26 @@ use Test::Exception;
{
my $foo;
- lives_ok(sub {
- $foo = Foo->new(bar => 42);
- });
+ is(
+ exception { $foo = Foo->new(bar => 42) },
+ undef,
+ );
is($foo->baz, 43);
}
{
my $foo;
- lives_ok(sub {
- $foo = Foo->new(baz => 23);
- });
+ is(
+ exception { $foo = Foo->new(baz => 23) },
+ undef,
+ );
is($foo->baz, 23);
}
-throws_ok(sub {
- Foo->new;
-}, qr/must be provided/);
+like(
+ exception { Foo->new },
+ qr/must be provided/,
+);
{
package Bar;
@@ -63,16 +66,18 @@ throws_ok(sub {
{
my $bar = Bar->new;
- throws_ok(sub {
- $bar->baz;
- }, qr/must be provided/);
+ like(
+ exception { $bar->baz },
+ qr/must be provided/,
+ );
$bar->foo(42);
my $baz;
- lives_ok(sub {
- $baz = $bar->baz;
- });
+ is(
+ exception { $baz = $bar->baz },
+ undef,
+ );
is($baz, 43);
}
@@ -110,16 +115,18 @@ SKIP:
{
my $bar = Quux->new;
- throws_ok(sub {
- $bar->baz;
- }, qr/must be provided/);
+ like(
+ exception { $bar->baz },
+ qr/must be provided/,
+ );
$bar->foo(42);
my $baz;
- lives_ok(sub {
- $baz = $bar->baz;
- });
+ is(
+ exception { $baz = $bar->baz },
+ undef,
+);
is($baz, 43);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmoosex-lazyrequire-perl.git
More information about the Pkg-perl-cvs-commits
mailing list