From 6ff12b877afbda62ad2cb6d748487e7674e5c396 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 5 Oct 2012 18:30:32 -0500 Subject: change back to defining helpers and functions separately helpers are different from functions because they implicitly receive the current context as the first argument, so they need to be declared differently. they work identically to functions in all other respects. --- t/block-helpers.t | 26 +++++++++++++------------- t/helpers-examples.t | 4 ++-- t/helpers.t | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 't') diff --git a/t/block-helpers.t b/t/block-helpers.t index 5ca009a..4b68d1e 100644 --- a/t/block-helpers.t +++ b/t/block-helpers.t @@ -7,7 +7,7 @@ use Test::Handlebars; render_ok( { - function => { + helpers => { noop => sub { my ($context, $options) = @_; return $options->{fn}->($context); @@ -36,7 +36,7 @@ RENDERED render_ok( { - function => { + helpers => { with => sub { my ($context, $new_context, $options) = @_; return $options->{fn}->($new_context); @@ -71,7 +71,7 @@ RENDERED render_ok( { - function => { + helpers => { with => sub { my ($context, $new_context, $options) = @_; return $options->{fn}->($new_context); @@ -138,7 +138,7 @@ RENDERED render_ok( { - function => { + helpers => { list => sub { my ($context, $items, $options) = @_; my $out = "