1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

fix test for template scopes

This commit is contained in:
Konstantin Haase 2011-02-19 14:14:17 +01:00
parent 8c00771486
commit 790e040cdf

View file

@ -231,16 +231,17 @@ class TemplatesTest < Test::Unit::TestCase
end end
it "passes scope to the template" do it "passes scope to the template" do
mock_app { mock_app do
template :scoped do template :scoped do
'Hello <%= foo %>' 'Hello <%= foo %>'
end end
get '/' do get '/' do
some_scope = Class.new; def foo; 'World!'; end; some_scope = Object.new
def some_scope.foo() 'World!' end
erb :scoped, :scope => some_scope erb :scoped, :scope => some_scope
end end
} end
get '/' get '/'
assert ok? assert ok?