Permalink
Browse files

Deprecate support for various testing frameworks

  • Loading branch information...
sr committed Feb 21, 2009
1 parent 9952b8d commit 8edd8c8e11c1687b8c7d5412df5a4b6675952ad3
Showing with 16 additions and 1 deletion.
  1. +8 −1 lib/sinatra/test.rb
  2. +2 −0 lib/sinatra/test/bacon.rb
  3. +2 −0 lib/sinatra/test/rspec.rb
  4. +2 −0 lib/sinatra/test/spec.rb
  5. +2 −0 lib/sinatra/test/unit.rb
View
@@ -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 'spec'
require 'spec/interop/test'
+Sinatra::Test.deprecate('RSpec')
+
Sinatra::Default.set(
:environment => :test,
:run => false,
View
@@ -2,6 +2,8 @@
require 'sinatra/test'
require 'sinatra/test/unit'
+Sinatra::Test.deprecate('test/spec')
+
module Sinatra::Test
def should
@response.should
View
@@ -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(

0 comments on commit 8edd8c8

Please sign in to comment.