From e5c538e469096cf12ec69d3828f81c1c56aacb5b Mon Sep 17 00:00:00 2001 From: Frank Schreiner Date: Wed, 17 Feb 2021 10:47:45 +0100 Subject: [PATCH] fix testing for Moose 2.2014 Without this patch the test suite breaks with the new Moose version (2.2014). This patch should be able to handle the old and the new error messages. fixes issue #62 --- t/05_extended.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/05_extended.t b/t/05_extended.t index 37dab9a..18e8063 100755 --- a/t/05_extended.t +++ b/t/05_extended.t @@ -241,7 +241,9 @@ subtest 'Test enum error message' => sub { MooseX::App::ParsedArgv->new(argv => [qw(somecommand --another hase hh h ggg)]); my $test18 = Test03->new_with_command(); isa_ok($test18,'MooseX::App::Message::Envelope'); - is($test18->blocks->[0]->body,"Value must be one of these values: aaa, bbb, ccc, ddd, eee, fff (not 'ggg')","Check enum error message"); + like($test18->blocks->[0]->body, + qr{(Value must be one of these values: aaa, bbb, ccc, ddd, eee, fff \(not 'ggg'\)|Validation failed for '__ANON__' with value "?ggg"?. Value must be equal to "aaa", "bbb", "ccc", "ddd", "eee", or "fff".)}, + "Check enum error message"); }; subtest 'Test empty multi' => sub { @@ -283,4 +285,4 @@ subtest 'Test mixed multi' => sub { my $test22 = Test03->new_with_command(); isa_ok($test22,'Test03::SomeCommand'); cmp_deeply($test22->list,[qw(val1 val2 val3 val4)],'List ok'); -}; \ No newline at end of file +};