mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Deprecate support for various testing frameworks
This commit is contained in:
parent
9952b8d4ef
commit
8edd8c8e11
5 changed files with 16 additions and 1 deletions
|
@ -1,12 +1,19 @@
|
|||
require 'sinatra/base'
|
||||
|
||||
module Sinatra
|
||||
|
||||
module Test
|
||||
include Rack::Utils
|
||||
|
||||
attr_reader :app, :request, :response
|
||||
|
||||
def self.deprecate(framework)
|
||||
warn <<-EOF
|
||||
Warning: support for the #{framework} testing framework is deprecated and
|
||||
will be dropped in Sinatra 1.0. See <http://sinatra.github.com/testing.html>
|
||||
for more information.
|
||||
EOF
|
||||
end
|
||||
|
||||
def make_request(verb, path, data=nil, h=nil)
|
||||
@app = Sinatra::Application if @app.nil? && defined?(Sinatra::Application)
|
||||
fail "@app not set - cannot make request" if @app.nil?
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
require 'bacon'
|
||||
require 'sinatra/test'
|
||||
|
||||
Sinatra::Test.deprecate('Bacon')
|
||||
|
||||
Sinatra::Default.set(
|
||||
:environment => :test,
|
||||
:run => false,
|
||||
|
|
|
@ -3,6 +3,8 @@ require 'sinatra/test/unit'
|
|||
require 'spec'
|
||||
require 'spec/interop/test'
|
||||
|
||||
Sinatra::Test.deprecate('RSpec')
|
||||
|
||||
Sinatra::Default.set(
|
||||
:environment => :test,
|
||||
:run => false,
|
||||
|
|
|
@ -2,6 +2,8 @@ require 'test/spec'
|
|||
require 'sinatra/test'
|
||||
require 'sinatra/test/unit'
|
||||
|
||||
Sinatra::Test.deprecate('test/spec')
|
||||
|
||||
module Sinatra::Test
|
||||
def should
|
||||
@response.should
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
require 'sinatra/test'
|
||||
require 'test/unit'
|
||||
|
||||
Sinatra::Test.deprecate('test/unit')
|
||||
|
||||
Test::Unit::TestCase.send :include, Sinatra::Test
|
||||
|
||||
Sinatra::Default.set(
|
||||
|
|
Loading…
Reference in a new issue