Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove disabled compat specs

  • Loading branch information...
commit 9460520723480866f070128dcf002509a403daff 1 parent 5a33a95
@rtomayko rtomayko authored
View
19 compat/app_test.rb
@@ -146,25 +146,6 @@ def foo ; 'blah' ; end
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'
View
72 compat/application_test.rb
@@ -10,47 +10,6 @@ def each
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 @@ def each
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 @@ def each
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
View
26 compat/pipeline_test.rb
@@ -23,32 +23,6 @@ def call(env)
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
View
6 compat/streaming_test.rb
@@ -105,9 +105,10 @@
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 @@
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
Please sign in to comment.
Something went wrong with that request. Please try again.