Aion

 view release on metacpan or  search on metacpan

t/aion/meta/feature.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Meta::Feature - метаописатель фичи
# 
# # SYNOPSIS
# 
subtest 'SYNOPSIS' => sub { 
use Aion::Meta::Feature;

our $feature = Aion::Meta::Feature->new("My::Package", "my_feature" => (is => 'rw'));

local ($::_g0 = do {$feature->stringify}, $::_e0 = "has my_feature => (is => 'rw') of My::Package"); ::ok $::_g0 eq $::_e0, '$feature->stringify  # => has my_feature => (is => \'rw\') of My::Package' or ::diag ::_string_diff($::_g0, $::_e0); undef $:...

# 
# # DESCRIPTION
# 
# Описывает фичу, которая добавляется в класс функцией `has`.
# 
# # METHODS
# 
# ## pkg
# Пакет, к которому относится фича.
# 
::done_testing; }; subtest 'pkg' => sub { 
local ($::_g0 = do {$::feature->pkg}, $::_e0 = do {"My::Package"}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '$::feature->pkg # -> "My::Package"' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;

# 
# ## name
# Имя фичи.
# 
::done_testing; }; subtest 'name' => sub { 
local ($::_g0 = do {$::feature->name}, $::_e0 = do {"my_feature"}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '$::feature->name # -> "my_feature"' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;

# 
# ## opt
# Хеш опций фичи.
# 
::done_testing; }; subtest 'opt' => sub { 
local ($::_g0 = do {$::feature->opt}, $::_e0 = do {{is => 'rw'}}); ::is_deeply $::_g0, $::_e0, '$::feature->opt # --> {is => \'rw\'}' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;

# 
# ## has
# Массив опций фичи в виде пар ключ-значение.
# 
::done_testing; }; subtest 'has' => sub { 
local ($::_g0 = do {$::feature->has}, $::_e0 = do {['is', 'rw']}); ::is_deeply $::_g0, $::_e0, '$::feature->has # --> [\'is\', \'rw\']' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;

# 
# ## construct
# Объект конструктора фичи.
# 
::done_testing; }; subtest 'construct' => sub { 
local ($::_g0 = do {ref $::feature->construct}, $::_e0 = 'Aion::Meta::FeatureConstruct'); ::ok $::_g0 eq $::_e0, 'ref $::feature->construct # \> Aion::Meta::FeatureConstruct' or ::diag ::_string_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;

# 
# ## order ()
# Порядковый номер фичи в классе.
# 
::done_testing; }; subtest 'order ()' => sub { 
local ($::_g0 = do {$::feature->order}, $::_e0 = do {0}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '$::feature->order # -> 0' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;



( run in 0.611 second using v1.01-cache-2.11-cpan-99c4e6809bf )