Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test for and avoid re-used packages in template construction

  • Loading branch information...
commit 404959da130bda752e4a979752b9b594e8a2974c 1 parent 2b662dc
@rjbs authored
View
3  Changes
@@ -1,5 +1,8 @@
Revision history for {{ $dist->name }}
+0.093160 2009-11-12
+ use fill_this_in instead of fill_in_string to avoid package error
+
0.092921 2009-10-19
catch another class of error
View
2  lib/Email/MIME/Kit/Renderer/Text/Template.pm
@@ -28,7 +28,7 @@ sub render {
(map {; $_ => ref $args->{$_} ? $args->{$_} : \$args->{$_} } keys %$args),
});
- my $result = Text::Template::fill_in_string(
+ my $result = Text::Template->fill_this_in(
$$input_ref,
%{ $self->{template_args} || {} },
HASH => $hash,
View
18 t/assemble.t
@@ -12,11 +12,15 @@ my $kit = Email::MIME::Kit->new({
my $email_1 = $kit->assemble({
name => 'Reticulo Johnson',
game => "eatin' pancakes",
+ postlude => ' OUT!',
});
-like(
- $email_1->body,
- qr{\QReticulo Johnson is my name, eatin' pancakes is my game},
+
+my $body_1 = $email_1->body;
+$body_1 =~ s{[\n\r]*\z}{}g;
+is(
+ $body_1,
+ q{Reticulo Johnson is my name, eatin' pancakes is my game. OUT!},
"template stuff happened",
);
@@ -25,9 +29,11 @@ my $email_2 = $kit->assemble({
game => "nukin' jar cheese",
});
-like(
- $email_2->body,
- qr{\QBryan Allen is my name, nukin' jar cheese is my game},
+my $body_2 = $email_2->body;
+$body_2 =~ s{[\n\r]*\z}{}g;
+is(
+ $body_2,
+ q{Bryan Allen is my name, nukin' jar cheese is my game.},
"template stuff happened",
);
View
2  t/kits/test.mkit/manifest.json
@@ -5,5 +5,5 @@
{ "From": "test@example.com" }
],
"type": "text/plain",
- "body": "{ $name } is my name, { $game } is my game."
+ "body": "{ $name } is my name, { $game } is my game.{ $postlude }"
}
Please sign in to comment.
Something went wrong with that request. Please try again.