Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /usr/share/doc/perl-MooseX-ConfigFromFile/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/perl-MooseX-ConfigFromFile/t/04b_getopt.t
use strict;
use warnings;

use Test::Requires 'MooseX::Getopt';    # skip all if not installed
use Test::More;
use if $ENV{AUTHOR_TESTING}, 'Test::Warnings';

{
    package Foo::Options;

    use Moose;
    with qw(MooseX::Getopt MooseX::ConfigFromFile);
    sub get_config_from_file { }
}

{
    package Foo::NoOptions;

    use Moose;
    with qw(MooseX::ConfigFromFile);
    sub get_config_from_file { }
}

ok(
    Foo::Options->meta->find_attribute_by_name('configfile')->does('MooseX::Getopt::Meta::Attribute::Trait'),
    'classes with MooseX::Getopt have the Getopt attr trait added',
);

ok(
    Foo::NoOptions->meta->find_attribute_by_name('configfile')->does('MooseX::Getopt::Meta::Attribute::Trait'),
    'when MooseX::Getopt is loaded, the Getopt attr trait is still added',
);

done_testing;

Hry