comparison _test/Test/Web/View.pm @ 301:aeeb57a12046

*IMPL::Web::View: templates inheritance support
author cin
date Mon, 25 Mar 2013 02:04:18 +0400
parents 85572f512abc
children 608e74bc309f
comparison
equal deleted inserted replaced
300:bf3af33b9003 301:aeeb57a12046
98 my $doc = $loader->document('simple'); 98 my $doc = $loader->document('simple');
99 99
100 assert(defined $doc); 100 assert(defined $doc);
101 101
102 $doc->title('test document'); 102 $doc->title('test document');
103 $doc->name('document');
103 104
104 assert($doc->name eq 'document'); 105 assert($doc->name eq 'document');
105 assert($doc->title eq 'test document'); 106 assert($doc->title eq 'test document');
106 107
107 assert(not $doc->can('notexists')); # autoloaded property should be ignored 108 assert(not $doc->can('notexists')); # autoloaded property should be ignored
139 $text_raw =~ s/\s+//g; 140 $text_raw =~ s/\s+//g;
140 $expected_raw =~ s/\s+//g; 141 $expected_raw =~ s/\s+//g;
141 assert($text_raw eq $expected_raw, '$doc->Render(): Bad output', "Got: $text", "Expected: $expected"); 142 assert($text_raw eq $expected_raw, '$doc->Render(): Bad output', "Got: $text", "Expected: $expected");
142 }; 143 };
143 144
145 test TestControlInheritance => sub {
146 my ($this) = @_;
147
148 my $loader = $this->CreateLoader();
149 my $doc = $loader->document('derived');
150
151 my $text = $doc->Render();
152 my $expected = read_file($this->GetResourceFile('Resources', 'TTView.Output', 'derived.txt'), binmode => ':utf8' );
153
154 my ($text_raw,$expected_raw) = ($text, $expected);
155 $text_raw =~ s/\s+//g;
156 $expected_raw =~ s/\s+//g;
157
158 assert($text_raw eq $expected_raw, '$doc->Render(): Bad output', "Got: $text", "Expected: $expected");
159 };
160
144 test TestDocumentsIsolation => sub { 161 test TestDocumentsIsolation => sub {
145 my $this = shift; 162 my $this = shift;
146 163
147 my $loader = $this->CreateLoader(); 164 my $loader = $this->CreateLoader();
148 165