diff _test/Test/Web/View.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 08015e2803f1
children 78a18a2b6266
line wrap: on
line diff
--- a/_test/Test/Web/View.pm	Wed Apr 04 02:49:45 2012 +0400
+++ b/_test/Test/Web/View.pm	Wed Apr 04 17:51:27 2012 +0400
@@ -22,7 +22,7 @@
 	my $code = shift;
 	my $dump = shift;
 	
-	my $data = MProfiler->Monitor($code, sub { $_ =~ m/^IMPL::/} );
+	my $data = MProfiler->Monitor($code);
 	
 	if ($data->isLeak and $dump) {
 		write_file("dump.out", { binmode => ':utf8' }, $data->Dump() );
@@ -108,6 +108,7 @@
 	my $loader = $this->CreateLoader();
 	
 	my $doc = $loader->document('simple');
+	$doc->templateVars(data => ['one','two','hello world']);
 	
 	assert(defined $doc);
 	
@@ -132,7 +133,9 @@
 	
 	$doc->appendChild($ctl);
 	
-	my $text = $ctl->Render({ data => ['one','two','hello world']});
+	
+	
+	my $text = $ctl->Render();
 	my $expected = read_file($this->GetResourceFile('Resources', 'TTView.Output', 'Panel.txt'), binmode => ':utf8');
 	
 	assert($text eq $expected, '$ctl->Render(): Bad output', "Got:      $text", "Expected: $expected");