Permalink
Browse files

Deprecate support for various testing frameworks

  • Loading branch information...
1 parent 9952b8d commit 8edd8c8e11c1687b8c7d5412df5a4b6675952ad3 @sr sr committed Feb 21, 2009
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(

2 comments on commit 8edd8c8

Which frameworks will be supported?

Member

sr replied Feb 22, 2009

None. You’ll have to “install” the Sinatra test helpers into your testing framework of choice. This will be documented (see http://sinatra.lighthouseapp.com/projects/9779/tickets/123-doc-testing-sinatra-apps) soon.

Please sign in to comment.