diff --git a/lib/liquid/template.rb b/lib/liquid/template.rb index 19c2bfa..3585dfc 100644 --- a/lib/liquid/template.rb +++ b/lib/liquid/template.rb @@ -93,9 +93,7 @@ module Liquid context = case args.first when Liquid::Context args.shift - when Liquid::Drop - Context.new(args.shift, instance_assigns, registers, @rethrow_errors) - when Hash + when Hash, Liquid::Drop Context.new([args.shift, assigns], instance_assigns, registers, @rethrow_errors, @resource_limits) when nil Context.new(assigns, instance_assigns, registers, @rethrow_errors, @resource_limits) diff --git a/test/liquid/template_test.rb b/test/liquid/template_test.rb index 5207f18..22e1eda 100644 --- a/test/liquid/template_test.rb +++ b/test/liquid/template_test.rb @@ -6,7 +6,7 @@ class TemplateContextDrop < Liquid::Drop end def foo - 'foo' + 'fizzbuzz' end end @@ -134,7 +134,7 @@ class TemplateTest < Test::Unit::TestCase def test_can_use_drop_as_context t = Template.new drop = TemplateContextDrop.new - assert_equal 'foo', t.parse('{{foo}}').render(drop) + assert_equal 'fizzbuzz', t.parse('{{foo}}').render(drop) assert_equal 'bar', t.parse('{{bar}}').render(drop) end end # TemplateTest