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:
parent
8c00771486
commit
790e040cdf
1 changed files with 4 additions and 3 deletions
|
@ -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?
|
||||||
|
|
Loading…
Reference in a new issue