1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00
sinatra/test/diddy_test.rb
Ryan Tomayko 60d50062d7 Fix whitespace errors across all source files and tests
I can't stand this shit anymore.
2008-08-31 02:10:37 -07:00

41 lines
675 B
Ruby

require File.dirname(__FILE__) + '/helper'
context "Diddy" do
setup do
Sinatra.application = nil
end
specify "should map urls to different apps" do
get '/' do
'asdf'
end
get_it '/'
assert ok?
assert_equal('asdf', body)
get '/foo', :host => 'foo.sinatrarb.com' do
'in foo!'
end
get '/foo', :host => 'bar.sinatrarb.com' do
'in bar!'
end
get_it '/foo', {}, 'HTTP_HOST' => 'foo.sinatrarb.com'
assert ok?
assert_equal 'in foo!', body
get_it '/foo', {}, 'HTTP_HOST' => 'bar.sinatrarb.com'
assert ok?
assert_equal 'in bar!', body
get_it '/foo'
assert not_found?
end
end