From ab4e7256bb3899d9fd950e26215ddc27a8331b8d Mon Sep 17 00:00:00 2001 From: Enric Lluelles Date: Mon, 23 Jan 2012 20:51:08 +0100 Subject: [PATCH] Added failing test --- spec/rack/livereload_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/rack/livereload_spec.rb b/spec/rack/livereload_spec.rb index 96d1cba..12fd1b9 100644 --- a/spec/rack/livereload_spec.rb +++ b/spec/rack/livereload_spec.rb @@ -53,6 +53,18 @@ describe Rack::LiveReload do end end + context 'unknown Content-Type' do + let(:ret) { [ 200, {}, [ 'hey ho' ] ] } + + before do + app.stubs(:call).with(env).returns(ret) + end + + it 'should not break' do + middleware.call(env).should_not raise_error(NoMethodError, /You have a nil object/) + end + end + context 'text/html' do before do app.stubs(:call).with(env).returns([ 200, { 'Content-Type' => 'text/html', 'Content-Length' => 0 }, [ '' ] ])