Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Moo and command line scripts

by tobyink (Canon)
on Nov 11, 2019 at 08:42 UTC ( [id://11108542]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Moo and command line scripts
in thread Moo and command line scripts

Yeah, it only becomes an issue if you're loading two classes that consume MooX::Role::CliOptions, and they each want different settings for the environment variable. None of your tests do that.

use 5.006; use strict; use warnings; use Test::More; { package My::Class1; use Moo; $ENV{MRC_NO_STDOPTS} = 1; # do NOT want 'debug' and 'verbose' with 'MooX::Role::CliOptions'; } { package My::Class2; use Moo; $ENV{MRC_NO_STDOPTS} = 0; # do want 'debug' and 'verbose' with 'MooX::Role::CliOptions'; } ok( ! My::Class1->new->can('verbose') ); ok( My::Class2->new->can('verbose') ); done_testing;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-24 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found