Skip to content

Commit

Permalink
Less strict error matching
Browse files Browse the repository at this point in the history
  • Loading branch information
beanz committed Nov 12, 2016
1 parent 42abce1 commit 37b7a75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions t/05-listener.t
Expand Up @@ -165,9 +165,8 @@ is(test_error(sub { $xpl->add_timer(timeout => -1) }),
ref($xpl)."->add_timer: requires 'id' parameter",
"adding timer with no id");

is(test_error(sub { $xpl->add_timer(id => 'null', timeout => 'tomorrow') }),
q{xPL::Timer->new: Failed to load xPL::Timer::tomorrow: }.
q{Can't locate xPL/Timer/tomorrow.pm in @INC},
like(test_error(sub { $xpl->add_timer(id => 'null', timeout => 'tomorrow') }),
qr{^xPL::Timer->new: Failed to load xPL::Timer::tomorrow:},
"adding timer with bad timeout");

is(test_error(sub { $xpl->add_timer(id => 'null') }),
Expand Down
4 changes: 2 additions & 2 deletions t/12-dock.t
Expand Up @@ -9,8 +9,8 @@ $|=1;

use_ok('xPL::Dock');

is(test_error(sub { xPL::Dock->import('invalid') }),
q{Failed loading plugin: Can't locate xPL/Dock/invalid.pm in @INC},
like(test_error(sub { xPL::Dock->import('invalid') }),
qr{^Failed loading plugin: Can't locate xPL/Dock/invalid\.pm in \@INC},
'plugin eval error');

my @usage = split /\n/,
Expand Down
4 changes: 2 additions & 2 deletions t/13-iohandler.t
Expand Up @@ -134,9 +134,9 @@ is(test_error(sub {
(q{MyIOH->device_open: TCP connect to '127.0.0.1:}.$port.
q{' failed: Connection refused}), 'connection refused');

is(test_error(sub { xPL::IOHandler->new(input_record_type =>
like(test_error(sub { xPL::IOHandler->new(input_record_type =>
'xPL::IORecord::NonExistent') }),
q{Can't locate xPL/IORecord/NonExistent.pm in @INC}, 'bad record type');
qr{^Can't locate xPL/IORecord/NonExistent\.pm in \@INC}, 'bad record type');


no warnings;
Expand Down

0 comments on commit 37b7a75

Please sign in to comment.