Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How can you unit test a Dancer2 plugin mehod?

by nysus (Parson)
on Nov 10, 2018 at 12:57 UTC ( [id://1225533]=note: print w/replies, xml ) Need Help??


in reply to How can you unit test a Dancer2 plugin mehod?

I found a decent solution, I think. Go down a layer of abstraction and create a Dancer2::Core::App object and modify it with provided methods.

my $app = Dancer2::Core::App->new(); $app->with_plugins( 'Menu' ); $app->add_route( method => 'get', regexp => '/test', code => sub {return 'hi'}, ); Dancer2::Plugin::Menu::_do_stuff($app);

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1225533]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-23 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found