annotate _test/Test/Class/Meta.pm @ 190:cd1ff7029a63

IMLP::Web::View refactored, added new method 'require' which is available inside templates. Changed document rendering.
author cin
date Wed, 04 Apr 2012 17:51:27 +0400
parents 76515373dac0
children 4d0e1962161c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
90
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
1 use strict;
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
2
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
3 package Test::Class::Meta;
165
76515373dac0 Added Class::Template,
wizard
parents: 90
diff changeset
4 use parent qw(IMPL::Test::Unit);
90
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
5
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
6 __PACKAGE__->PassThroughArgs;
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
7
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
8 use IMPL::Test qw(test failed);
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
9
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
10 test defineFooClassData => sub {
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
11 Foo->class_data(info => {});
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
12 };
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
13
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
14 test updateFooClassData => sub {
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
15 Foo->class_data('info')->{data} = 'Foo' ;
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
16 };
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
17
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
18 test getFooClassData => sub {
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
19 failed "Wrong class data", "Expected: Foo", "Got: ".Foo->class_data('info')->{data} unless Foo->class_data('info')->{data} eq 'Foo';
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
20 };
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
21
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
22 test getBazClassData => sub {
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
23 failed "Wrong class data", "Expected: Foo", "Got: ".Baz->class_data('info')->{data} unless Baz->class_data('info')->{data} eq 'Foo';
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
24 };
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
25
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
26 test updateBarClassData => sub {
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
27 Bar->class_data('info')->{data} = 'Bar';
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
28 };
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
29
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
30 test getBarClassData => sub {
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
31 failed "Wrong class data", "Expected: Bar", "Got: ".Bar->class_data('info')->{data} unless Bar->class_data('info')->{data} eq 'Bar';
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
32 };
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
33
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
34 test validatetFooClassData => sub {
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
35 failed "Wrong class data", "Expected: Foo", "Got: ".Foo->class_data('info')->{data} unless Foo->class_data('info')->{data} eq 'Foo';
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
36 };
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
37
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
38 test validateBazClassData => sub {
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
39 failed "Wrong class data", "Expected: Foo", "Got: ".Baz->class_data('info')->{data} unless Baz->class_data('info')->{data} eq 'Foo';
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
40 };
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
41
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
42 test getwrongBazClassData => sub {
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
43 failed "Wrong class data", "Expected: undef", "Got: ".Foo->class_data( 'info2' ) if Foo->class_data( 'info2' );
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
44 };
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
45
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
46
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
47
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
48 package Foo;
165
76515373dac0 Added Class::Template,
wizard
parents: 90
diff changeset
49 use parent qw(IMPL::Class::Meta);
90
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
50
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
51 package Bar;
165
76515373dac0 Added Class::Template,
wizard
parents: 90
diff changeset
52 use parent qw(-norequire Foo);
90
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
53
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
54 package Baz;
165
76515373dac0 Added Class::Template,
wizard
parents: 90
diff changeset
55 use parent qw(-norequire Foo);
90
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
56
dc1da0389db7 Small improvements in the abstract object class
wizard
parents:
diff changeset
57 1;