compat/haml_test.rb in sinatra-0.9.1.1 vs compat/haml_test.rb in sinatra-0.9.2
- old
+ new
@@ -181,17 +181,18 @@
describe 'Options passed to the HAML interpreter' do
setup do
Sinatra.application = nil
end
- specify 'are empty be default' do
+ specify 'default to filename and line of caller' do
get '/' do
haml 'foo'
end
- Haml::Engine.expects(:new).with('foo', {}).returns(stub(:render => 'foo'))
+ Haml::Engine.expects(:new).with('foo', {:filename => __FILE__,
+ :line => (__LINE__-4)}).returns(stub(:render => 'foo'))
get_it '/'
should.be.ok
end
@@ -200,11 +201,12 @@
get '/' do
haml 'foo', :options => {:format => :html4}
end
- Haml::Engine.expects(:new).with('foo', {:format => :html4}).returns(stub(:render => 'foo'))
+ Haml::Engine.expects(:new).with('foo', {:filename => __FILE__,
+ :line => (__LINE__-4), :format => :html4}).returns(stub(:render => 'foo'))
get_it '/'
should.be.ok
end
@@ -218,10 +220,11 @@
get '/' do
haml 'foo'
end
- Haml::Engine.expects(:new).with('foo', {:format => :html4,
+ Haml::Engine.expects(:new).with('foo', {:filename => __FILE__,
+ :line => (__LINE__-4), :format => :html4,
:escape_html => true}).returns(stub(:render => 'foo'))
get_it '/'
should.be.ok