diff --git a/lib/sinatra/test.rb b/lib/sinatra/test.rb index b4b758ae..f3c0fe78 100644 --- a/lib/sinatra/test.rb +++ b/lib/sinatra/test.rb @@ -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 +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? diff --git a/lib/sinatra/test/bacon.rb b/lib/sinatra/test/bacon.rb index 0371e2fa..66c0b135 100644 --- a/lib/sinatra/test/bacon.rb +++ b/lib/sinatra/test/bacon.rb @@ -1,6 +1,8 @@ require 'bacon' require 'sinatra/test' +Sinatra::Test.deprecate('Bacon') + Sinatra::Default.set( :environment => :test, :run => false, diff --git a/lib/sinatra/test/rspec.rb b/lib/sinatra/test/rspec.rb index 6fff671e..971b96f6 100644 --- a/lib/sinatra/test/rspec.rb +++ b/lib/sinatra/test/rspec.rb @@ -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, diff --git a/lib/sinatra/test/spec.rb b/lib/sinatra/test/spec.rb index 95a80934..daffe32c 100644 --- a/lib/sinatra/test/spec.rb +++ b/lib/sinatra/test/spec.rb @@ -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 diff --git a/lib/sinatra/test/unit.rb b/lib/sinatra/test/unit.rb index 021ad4c5..a7e60b3a 100644 --- a/lib/sinatra/test/unit.rb +++ b/lib/sinatra/test/unit.rb @@ -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(