Skip to content

Commit

Permalink
Remove disabled compat specs
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Feb 23, 2009
1 parent 5a33a95 commit 9460520
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 120 deletions.
19 changes: 0 additions & 19 deletions compat/app_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
72 changes: 0 additions & 72 deletions compat/application_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
26 changes: 0 additions & 26 deletions compat/pipeline_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions compat/streaming_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@
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 '/'

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
Expand Down

0 comments on commit 9460520

Please sign in to comment.