1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00
sinatra/test/integration/app.rb
2012-03-07 23:03:28 +01:00

36 lines
434 B
Ruby

$stderr.puts "loading"
require 'sinatra'
configure do
set :foo, :bar
end
get '/app_file' do
content_type :txt
settings.app_file
end
get '/ping' do
'pong'
end
get '/stream' do
stream do |out|
sleep 0.1
out << "a"
sleep 1.2
out << "b"
end
end
get '/mainonly' do
object = Object.new
begin
object.send(:get, '/foo') { }
'false'
rescue NameError
'true'
end
end
$stderr.puts "starting"