diff _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
line wrap: on
line diff
--- a/_test/Test/Web/View.pm	Fri Mar 22 01:05:11 2013 +0400
+++ b/_test/Test/Web/View.pm	Mon Mar 25 02:04:18 2013 +0400
@@ -100,6 +100,7 @@
     assert(defined $doc);
     
     $doc->title('test document');
+    $doc->name('document');
     
     assert($doc->name eq 'document');
     assert($doc->title eq 'test document');
@@ -141,6 +142,22 @@
     assert($text_raw eq $expected_raw, '$doc->Render(): Bad output', "Got:      $text", "Expected: $expected"); 
 };
 
+test TestControlInheritance => sub {
+    my ($this) = @_;
+    
+    my $loader = $this->CreateLoader();
+    my $doc = $loader->document('derived');
+    
+    my $text = $doc->Render();
+    my $expected = read_file($this->GetResourceFile('Resources', 'TTView.Output', 'derived.txt'), binmode => ':utf8' );
+    
+    my ($text_raw,$expected_raw) = ($text, $expected);
+    $text_raw =~ s/\s+//g;
+    $expected_raw =~ s/\s+//g;
+    
+    assert($text_raw eq $expected_raw, '$doc->Render(): Bad output', "Got:      $text", "Expected: $expected");
+};
+
 test TestDocumentsIsolation => sub {
 	my $this = shift;