add (failing) test to check that there are no warnings

This commit is contained in:
Konstantin Haase 2012-03-18 10:18:00 +01:00
parent fbdb25bb0d
commit ea653dbf2d
2 changed files with 11 additions and 1 deletions

View File

@ -108,7 +108,7 @@ module IntegrationHelper
file, dir = RbConfig::CONFIG.values_at('ruby_install_name', 'bindir')
cmd << File.expand_path(file, dir).inspect
end
cmd << "-I" << File.expand_path('../../lib', __FILE__).inspect
cmd << "-w" << "-I" << File.expand_path('../../lib', __FILE__).inspect
cmd << app_file.inspect << '-s' << server << '-o' << '127.0.0.1' << '-p' << port
cmd << "-e" << environment.to_s << '2>&1'
cmd.join " "
@ -126,6 +126,10 @@ module IntegrationHelper
def webrick?
name.to_s == "webrick"
end
def warnings
log.scan(%r[(?:\(eval|lib/sinatra).*warning:.*$])
end
end
if RUBY_ENGINE == "jruby"

View File

@ -77,4 +77,10 @@ class IntegrationTest < Test::Unit::TestCase
assert_match exp, server.log
end
it 'does not generate warnings' do
assert_raise(OpenURI::HTTPError) { server.get '/' }
server.get '/app_file'
assert_empty server.warnings
end
end