Skip to content

Commit

Permalink
Merge branch 'eval-check'
Browse files Browse the repository at this point in the history
This branch contains checks from dcf42bd
and 2e6ab9c (and a single line from
e0b1895).

The sum of changes constitute adding the "eval" check for creation of
a Test::Ping object (which is much more correct indeed), and for adding
an entry in MANIFEST for two added tests. (Not because it's related but
because I'm too tired to separate them now. "Eh, why not.")
  • Loading branch information
xsawyerx committed Mar 6, 2016
2 parents 3403d31 + 68311a8 commit 3ae0241
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions MANIFEST
Expand Up @@ -31,6 +31,8 @@ t/13-service.t
t/14-ping_icmp.t
t/15-ping_udp.t
t/16-ties.t
t/17-ping_obj_not_ok.t
t/18-ping_obj_ok.t
t/critic.t
t/meta.t
t/pod-coverage.t
Expand Down
15 changes: 7 additions & 8 deletions lib/Test/Ping.pm
Expand Up @@ -72,22 +72,21 @@ sub create_ping_object_ok {
my @args = @_;
my $name = pop @args || q{};
my $tb = $CLASS->builder;
$OBJPATH = Net::Ping->new(@args);

if ($OBJPATH) {
$tb->is_eq( ref $OBJPATH, 'Net::Ping', $name );
} else {
$tb->ok( 0, $name );
}
eval { $OBJPATH = Net::Ping->new(@args); };

$tb->is_eq( ref $OBJPATH, 'Net::Ping', $name );
}

sub create_ping_object_not_ok {
my @args = @_;
my $name = pop @args || q{};
my $tb = $CLASS->builder;
$OBJPATH = Net::Ping->new(@args);
my $error;
eval { Net::Ping->new(@args); 1; }
or $error = $@;

$tb->ok( !$OBJPATH, $name );
$tb->ok( $error, $name );
}

sub _has_var_ok {
Expand Down

0 comments on commit 3ae0241

Please sign in to comment.