summaryrefslogtreecommitdiffstats
path: root/t/block-helpers.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-05 18:30:32 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-05 18:30:32 -0500
commit6ff12b877afbda62ad2cb6d748487e7674e5c396 (patch)
tree74fa460cfbb35ff23603a8ee4e3a84c7d2dda52b /t/block-helpers.t
parentf805baad91b66f47885160afaed141a4e4c5fa67 (diff)
downloadtext-handlebars-6ff12b877afbda62ad2cb6d748487e7674e5c396.tar.gz
text-handlebars-6ff12b877afbda62ad2cb6d748487e7674e5c396.zip
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.
Diffstat (limited to 't/block-helpers.t')
-rw-r--r--t/block-helpers.t26
1 files changed, 13 insertions, 13 deletions
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 = "<ul>";
@@ -178,7 +178,7 @@ RENDERED
render_ok(
{
- function => {
+ helpers => {
if => sub {
my ($context, $conditional, $options) = @_;
if ($conditional) {
@@ -204,7 +204,7 @@ RENDERED
render_ok(
{
- function => {
+ helpers => {
if => sub {
my ($context, $conditional, $options) = @_;
if ($conditional) {
@@ -229,7 +229,7 @@ RENDERED
render_ok(
{
- function => {
+ helpers => {
if => sub {
my ($context, $conditional, $options) = @_;
if ($conditional) {
@@ -259,7 +259,7 @@ RENDERED
render_ok(
{
- function => {
+ helpers => {
if => sub {
my ($context, $conditional, $options) = @_;
if ($conditional) {
@@ -290,7 +290,7 @@ RENDERED
{ local $TODO = "unimplemented"; local $SIG{__WARN__} = sub { };
render_ok(
{
- function => {
+ helpers => {
list => sub {
my ($context, $items, $options) = @_;
@@ -336,7 +336,7 @@ RENDERED
# more reasonable. feedback welcome!
render_ok(
{
- function => {
+ helpers => {
list => sub {
my ($context, $items, $options) = @_;
@@ -380,7 +380,7 @@ RENDERED
render_ok(
{
- function => {
+ helpers => {
list => sub {
my ($context, $items, $options) = @_;
@@ -413,7 +413,7 @@ render_ok(
render_ok(
{
- function => {
+ helpers => {
list => sub {
my ($context, $items, $options) = @_;
@@ -443,7 +443,7 @@ render_ok(
render_ok(
{
- function => {
+ helpers => {
list => sub {
my ($context, $items, $options) = @_;