From 59a63e0fe579272be55622c05c665bd0aa92f02f Mon Sep 17 00:00:00 2001 From: Steven Soroka Date: Sun, 24 Apr 2011 01:09:56 -0500 Subject: [PATCH] fix failing test "recursively_included_template_does_not_produce_endless_loop", push needs to come before exception raise since pop is in ensure block and always happens. --- lib/liquid/context.rb | 2 +- test/test_helper.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/liquid/context.rb b/lib/liquid/context.rb index d37cf91..1075c4e 100644 --- a/lib/liquid/context.rb +++ b/lib/liquid/context.rb @@ -63,8 +63,8 @@ module Liquid # Push new local scope on the stack. use Context#stack instead def push(new_scope={}) - raise StackLevelError, "Nesting too deep" if @scopes.length > 100 @scopes.unshift(new_scope) + raise StackLevelError, "Nesting too deep" if @scopes.length > 100 end # Merge a hash of variables in the current local scope diff --git a/test/test_helper.rb b/test/test_helper.rb index 32f96f5..bdc5f5d 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,13 +2,13 @@ extras_path = File.join File.dirname(__FILE__), 'extra' $LOAD_PATH.unshift(extras_path) unless $LOAD_PATH.include? extras_path -require 'rubygems' unless RUBY_VERSION =~ /^(?:1.9.*)$/ +require 'rubygems' unless RUBY_VERSION >= '1.9' require 'test/unit' require 'test/unit/assertions' require 'caller' require 'breakpoint' require 'ruby-debug' -require File.join File.dirname(__FILE__), '..', 'lib', 'liquid' +require File.join(File.dirname(__FILE__), '..', 'lib', 'liquid') module Test