mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Remove disabled compat specs
This commit is contained in:
parent
5a33a9586f
commit
9460520723
4 changed files with 3 additions and 120 deletions
|
@ -146,25 +146,6 @@ context "Sinatra" do
|
|||
|
||||
end
|
||||
|
||||
# Deprecated. WTF was going on here? What's the 1 in [:foo, 1] do?
|
||||
xspecify "should set status then call helper with a var" do
|
||||
helpers do
|
||||
def foo
|
||||
'bah!'
|
||||
end
|
||||
end
|
||||
|
||||
get '/set_body' do
|
||||
stop [404, [:foo, 1]]
|
||||
end
|
||||
|
||||
get_it '/set_body'
|
||||
|
||||
should.be.not_found
|
||||
body.should.equal 'bah!'
|
||||
|
||||
end
|
||||
|
||||
specify "should easily set response Content-Type" do
|
||||
get '/foo.html' do
|
||||
content_type 'text/html', :charset => 'utf-8'
|
||||
|
|
|
@ -10,47 +10,6 @@ class TesterWithEach
|
|||
end
|
||||
end
|
||||
|
||||
context "Looking up a request" do
|
||||
|
||||
setup do
|
||||
Sinatra.application = nil
|
||||
end
|
||||
|
||||
# Deprecated. The lookup method is no longer used.
|
||||
xspecify "returns what's at the end" do
|
||||
block = Proc.new { 'Hello' }
|
||||
get '/', &block
|
||||
|
||||
result = Sinatra.application.lookup(
|
||||
Rack::Request.new(
|
||||
'REQUEST_METHOD' => 'GET',
|
||||
'PATH_INFO' => '/'
|
||||
)
|
||||
)
|
||||
|
||||
result.should.not.be.nil
|
||||
result.block.should.be block
|
||||
end
|
||||
|
||||
# Deprecated. The lookup method is no longer used.
|
||||
xspecify "takes params in path" do
|
||||
block = Proc.new { 'Hello' }
|
||||
get '/:foo', &block
|
||||
|
||||
result = Sinatra.application.lookup(
|
||||
Rack::Request.new(
|
||||
'REQUEST_METHOD' => 'GET',
|
||||
'PATH_INFO' => '/bar'
|
||||
)
|
||||
)
|
||||
|
||||
result.should.not.be.nil
|
||||
result.block.should.be block
|
||||
result.params.should.equal "foo" => 'bar'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "An app returns" do
|
||||
|
||||
setup do
|
||||
|
@ -85,20 +44,6 @@ context "An app returns" do
|
|||
|
||||
end
|
||||
|
||||
# Deprecated. The body method no longer halts.
|
||||
xspecify "the body set if set before the last" do
|
||||
|
||||
get '/' do
|
||||
body 'Blake'
|
||||
'Mizerany'
|
||||
end
|
||||
|
||||
get_it '/'
|
||||
should.be.ok
|
||||
body.should.equal 'Blake'
|
||||
|
||||
end
|
||||
|
||||
specify "404 if NotFound is raised" do
|
||||
|
||||
get '/' do
|
||||
|
@ -143,23 +88,6 @@ context "Application#configure blocks" do
|
|||
|
||||
end
|
||||
|
||||
context "Default Application Configuration" do
|
||||
|
||||
# Sinatra::ServerError is no longer used
|
||||
xspecify "includes 404 and 500 error handlers" do
|
||||
Sinatra.application.errors.should.include(Sinatra::ServerError)
|
||||
Sinatra.application.errors[Sinatra::ServerError].should.not.be.nil
|
||||
Sinatra.application.errors.should.include(Sinatra::NotFound)
|
||||
Sinatra.application.errors[Sinatra::NotFound].should.not.be.nil
|
||||
end
|
||||
|
||||
# Deprecated. No such thing as a Static event anymore.
|
||||
xspecify "includes Static event" do
|
||||
assert Sinatra.application.events[:get].any? { |e| Sinatra::Static === e }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "Events in an app" do
|
||||
|
||||
setup do
|
||||
|
|
|
@ -23,32 +23,6 @@ context "Middleware Pipelines" do
|
|||
Sinatra.application = nil
|
||||
end
|
||||
|
||||
# Sessions and logging are tested elsewhere. This is a bad test because it
|
||||
# asserts things about the implementation and not the effect.
|
||||
xspecify "includes default middleware with options set" do
|
||||
@app.set_options :sessions => true, :logging => true
|
||||
@app.send(:optional_middleware).should.include([Rack::Session::Cookie, [], nil])
|
||||
@app.send(:optional_middleware).should.include([Rack::CommonLogger, [], nil])
|
||||
end
|
||||
|
||||
# Bad test.
|
||||
xspecify "does not include default middleware with options unset" do
|
||||
@app.set_options :sessions => false, :logging => false
|
||||
@app.send(:optional_middleware).should.not.include([Rack::Session::Cookie, [], nil])
|
||||
@app.send(:optional_middleware).should.not.include([Rack::CommonLogger, [], nil])
|
||||
end
|
||||
|
||||
# Bad test.
|
||||
xspecify "includes only optional middleware when no explicit middleware added" do
|
||||
@app.set_options :sessions => true, :logging => true
|
||||
@app.send(:middleware).should.equal @app.send(:optional_middleware)
|
||||
end
|
||||
|
||||
# Bad test.
|
||||
xspecify "should clear middleware before reload" do
|
||||
@app.clearables.should.include(@app.send(:explicit_middleware))
|
||||
end
|
||||
|
||||
specify "should add middleware with use" do
|
||||
block = Proc.new { |env| }
|
||||
@app.use UpcaseMiddleware
|
||||
|
|
|
@ -105,9 +105,10 @@ context "SendData" do
|
|||
end
|
||||
|
||||
# Deprecated. The Content-Disposition is no longer handled by sendfile.
|
||||
xspecify "should include a Content-Disposition header" do
|
||||
specify "should include a Content-Disposition header" do
|
||||
get '/' do
|
||||
send_file File.dirname(__FILE__) + '/public/foo.xml'
|
||||
send_file File.dirname(__FILE__) + '/public/foo.xml',
|
||||
:disposition => 'attachment'
|
||||
end
|
||||
|
||||
get_it '/'
|
||||
|
@ -115,7 +116,6 @@ context "SendData" do
|
|||
should.be.ok
|
||||
headers['Content-Disposition'].should.not.be.nil
|
||||
headers['Content-Disposition'].should.equal 'attachment; filename="foo.xml"'
|
||||
headers['Content-Transfer-Encoding'].should.equal 'binary'
|
||||
end
|
||||
|
||||
specify "should include a Content-Disposition header when :disposition set to attachment" do
|
||||
|
|
Loading…
Reference in a new issue