view _test/Test/Class/Meta.pm @ 250:129e48bb5afb

DOM refactoring ObjectToDOM methods are virtual QueryToDOM uses inflators Fixed transform for the complex values in the ObjectToDOM QueryToDOM doesn't allow to use complex values (HASHes) as values for nodes (overpost problem)
author sergey
date Wed, 07 Nov 2012 04:17:53 +0400
parents a8db61d0ed33
children
line wrap: on
line source

use strict;

package Test::Class::Meta;
use parent qw(IMPL::Test::Unit);

__PACKAGE__->PassThroughArgs;

use IMPL::Test qw(test failed assert);

test defineFooClassData => sub {
    Foo->static_accessor(info => {},'clone');    
};

test updateFooClassData => sub {
    Foo->info->{data} = 'Foo' ;
};

test getFooClassData => sub {
    assert( Foo->info->{data} eq 'Foo' );
};

test getBazClassData => sub {
    assert( Baz->info->{data} eq 'Foo' );
    assert( Bar->info->{data} eq 'Foo' );
};

test updateBarClassData => sub {
    Bar->info->{data} = 'Bar';
};

test getBarClassData => sub {
    assert( Bar->info->{data} eq 'Bar');
};

test validatetFooClassData => sub {
    assert( Foo->info->{data} eq 'Foo');
};

test validateBazClassData => sub {
    assert( Baz->info->{data} eq 'Foo');
};

test getwrongBazClassData => sub {
    assert( not eval { Foo->info2; 1; } );
};



package Foo;
use parent qw(IMPL::Class::Meta);

package Bar;
use parent qw(-norequire Foo);

package Baz;
use parent qw(-norequire Foo);

1;