test/test-erubis.rb in erubis-2.4.0 vs test/test-erubis.rb in erubis-2.4.1
- old
+ new
@@ -1,8 +1,8 @@
##
-## $Rev: 91 $
-## $Release: 2.4.0 $
+## $Rev: 94 $
+## $Release: 2.4.1 $
## copyright(c) 2006-2007 kuwata-lab.com all rights reserved.
##
require "#{File.dirname(__FILE__)}/test.rb"
@@ -190,10 +190,25 @@
# convert() must clear @_proc
eruby.convert(s)
assert_nil(eruby.instance_variable_get('@_proc'))
end
+ #def test_toplevel_binding
+ # s = "locals = <%= local_variables().inspect %>\n<% x = 50 %>\n"
+ # eruby = Erubis::Eruby.new(s)
+ # _x = eval 'x', TOPLEVEL_BINDING
+ # _y = eval 'y', TOPLEVEL_BINDING
+ # actual = eruby.evaluate(:x=>_x, :y=>_y)
+ # _x = eval 'x', TOPLEVEL_BINDING
+ # _y = eval 'y', TOPLEVEL_BINDING
+ # puts "*** actual=#{actual.inspect}, x=#{_x.inspect}, y=#{_y.inspect}"
+ #end
+
end
+
+x = 10
+y = 20
+
__END__
- name: basic1
input: &basic1_input|
<ul>