[dancer-users] Testing D2 Plugins calling plugin_setting

Sawyer X xsawyerx at gmail.com
Sun Nov 23 12:00:32 GMT 2014


This is because you're calling plugin_setting() in the wrong context.

Where is the code? :)

On Sun, Nov 23, 2014 at 11:00 AM, Henk van Oers <hvo.pm at xs4all.nl> wrote:

>
> In Dancer2-Plugin-Passphrase I have this test:
>
> --- 003_default_settings.t ---
> use Test::More tests => 3;
>
> use strict;
> use warnings;
>
> use Dancer2;
> use Dancer2::Plugin::Passphrase;
>
> my $secret = "Super Secret Squirrel";
>
> my $rfc2307 = passphrase($secret)->generate->rfc2307;
>
> like($rfc2307, qr/^{CRYPT}\$2a\$04\$/,      'RFC compliant hash
> generated');
> ok(passphrase($secret)->matches($rfc2307),  'Match plaintext to hash');
> ok(!passphrase('WRONG')->matches($rfc2307), 'Incorrect passwords should
> be rejected');
>
> --- ---
>
> CPANtesters use the latest D2,
> which contains a "croak 'No DSL object found'"
>
> See:
> http://www.cpantesters.org/cpan/report/d4473e02-7246-
> 11e4-ac74-95bbe0bfc7aa
>
> How do I add a DSL to this test?
>
> Thanks,
> Henk
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20141123/292ce5a0/attachment.html>


More information about the dancer-users mailing list