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