diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index f027a960..406008f9 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -304,7 +304,7 @@ module Sinatra options[:layout] = false render :sass, template, options, locals end - + def less(template, options={}, locals={}) options[:layout] = false render :less, template, options, locals diff --git a/test/less_test.rb b/test/less_test.rb index 9ce9aa9b..f6cd72fd 100644 --- a/test/less_test.rb +++ b/test/less_test.rb @@ -9,25 +9,25 @@ class LessTest < Test::Unit::TestCase } get '/' end - + it 'renders inline Less strings' do less_app { less "@white_color: #fff; #main { background-color: @white_color }"} assert ok? assert_equal "#main { background-color: #ffffff; }\n", body end - + it 'renders .less files in views path' do less_app { less :hello } assert ok? assert_equal "#main { background-color: #ffffff; }\n", body end - + it 'ignores the layout option' do less_app { less :hello, :layout => :layout2 } assert ok? assert_equal "#main { background-color: #ffffff; }\n", body end - + it "raises error if template not found" do mock_app { get('/') { less :no_such_template }