Skip to content

Commit

Permalink
Avoid depending on the exact wording of Perl error messages
Browse files Browse the repository at this point in the history
As of Perl 5.21.7, a invocant-less method call like `htm::div {}` when no
htm::div subroutine exists now yields an error message describing the
absence of the invocant, rather than the nonexistence of the subroutine.

This change avoids looking at the wording of Perl's error message, and
instead directly verifies that no htm::div subroutine is created by such
code (which is what I think the test is trying to ensure).
  • Loading branch information
arc authored and alexmv committed Dec 17, 2014
1 parent 116d93d commit ce3b57d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion t/namespace.t
Expand Up @@ -55,7 +55,7 @@ template main => sub {

eval "htm::div {};";
::ok $@, 'htm:: is invalid';
::like $@, qr/Can't locate object method "div" via package "htm"/, 'package htm is intact';
::ok !defined &htm::div, 'package htm is intact';

package main;
Template::Declare->init( dispatch_to => ['MyApp::Templates']);
Expand Down

0 comments on commit ce3b57d

Please sign in to comment.