Mercurial > pub > Impl
view _test/Test/Resources/Format.pm @ 187:927653d01f4f
TTControl::AUTOLOAD now accesses nodeProperties
Added TTControl::renderBlock property to access RENDER block of the template
author | sergey |
---|---|
date | Tue, 03 Apr 2012 07:54:25 +0400 |
parents | 4267a2ac3d46 |
children |
line wrap: on
line source
package Test::Resources::Format; use strict; use warnings; use parent qw(IMPL::Test::Unit); use IMPL::Test qw(test failed); use IMPL::Resources::Format qw(FormatMessage); __PACKAGE__->PassThroughArgs; { package Args; use parent qw(IMPL::Object); sub foo { return { name => 'Args::foo', value => 'some value'} } } test FormatMessage => sub { my $format = 'This is a %name% message. %args.foo.name% has %args.foo.value% and %some.unknown.param%'; my $args = { name => 'Test', args => new Args() }; my $result = FormatMessage($format,$args); my $expected = 'This is a Test message. Args::foo has some value and [some.unknown.param]'; failed "Format message returned unexpected results", "Expected: $expected", "Recieved: $result" unless $result eq $expected; }; 1;