add (failing) test to check that there are no warnings
This commit is contained in:
parent
fbdb25bb0d
commit
ea653dbf2d
|
@ -108,7 +108,7 @@ module IntegrationHelper
|
||||||
file, dir = RbConfig::CONFIG.values_at('ruby_install_name', 'bindir')
|
file, dir = RbConfig::CONFIG.values_at('ruby_install_name', 'bindir')
|
||||||
cmd << File.expand_path(file, dir).inspect
|
cmd << File.expand_path(file, dir).inspect
|
||||||
end
|
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 << app_file.inspect << '-s' << server << '-o' << '127.0.0.1' << '-p' << port
|
||||||
cmd << "-e" << environment.to_s << '2>&1'
|
cmd << "-e" << environment.to_s << '2>&1'
|
||||||
cmd.join " "
|
cmd.join " "
|
||||||
|
@ -126,6 +126,10 @@ module IntegrationHelper
|
||||||
def webrick?
|
def webrick?
|
||||||
name.to_s == "webrick"
|
name.to_s == "webrick"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def warnings
|
||||||
|
log.scan(%r[(?:\(eval|lib/sinatra).*warning:.*$])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if RUBY_ENGINE == "jruby"
|
if RUBY_ENGINE == "jruby"
|
||||||
|
|
|
@ -77,4 +77,10 @@ class IntegrationTest < Test::Unit::TestCase
|
||||||
|
|
||||||
assert_match exp, server.log
|
assert_match exp, server.log
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'does not generate warnings' do
|
||||||
|
assert_raise(OpenURI::HTTPError) { server.get '/' }
|
||||||
|
server.get '/app_file'
|
||||||
|
assert_empty server.warnings
|
||||||
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue