Get rid of use_in_file_templates!
This commit is contained in:
parent
8d45055ac6
commit
7ab3565256
|
@ -721,12 +721,6 @@ module Sinatra
|
|||
template name, &block
|
||||
end
|
||||
|
||||
def use_in_file_templates!(file=nil)
|
||||
warn "use_in_file_templates! is deprecated; " \
|
||||
"use enable :inline_templates instead"
|
||||
set :inline_templates, file
|
||||
end
|
||||
|
||||
# Load embeded templates from the file; uses the caller's __FILE__
|
||||
# when no file is specified.
|
||||
def inline_templates=(file=nil)
|
||||
|
|
|
@ -76,9 +76,9 @@ class TemplatesTest < Test::Unit::TestCase
|
|||
assert_equal "Layout 3!\nHello World!\n", body
|
||||
end
|
||||
|
||||
it 'loads templates from source file with use_in_file_templates!' do
|
||||
it 'loads templates from source file with inline_templates enabled' do
|
||||
mock_app {
|
||||
use_in_file_templates!
|
||||
enable :inline_templates
|
||||
}
|
||||
assert_equal "this is foo\n\n", @app.templates[:foo][0]
|
||||
assert_equal "X\n= yield\nX\n", @app.templates[:layout][0]
|
||||
|
@ -93,7 +93,7 @@ class TemplatesTest < Test::Unit::TestCase
|
|||
test 'use_in_file_templates simply ignores IO errors' do
|
||||
assert_nothing_raised {
|
||||
mock_app {
|
||||
use_in_file_templates!('/foo/bar')
|
||||
set :inline_templates, '/foo/bar'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue