Permalink
Browse files

Don't depend on sinatra/test/unit in internal test

  • Loading branch information...
sr authored and rtomayko committed Feb 14, 2009
1 parent 42cb875 commit f9b13eee804574e6e76f98dda5c16a55f6cada58
Showing with 17 additions and 8 deletions.
  1. +17 −8 test/helper.rb
View
@@ -8,10 +8,24 @@
libdir = File.dirname(File.dirname(__FILE__)) + '/lib'
$LOAD_PATH.unshift libdir unless $LOAD_PATH.include?(libdir)
-require 'sinatra/base'
-require 'sinatra/test/unit'
+require 'test/unit'
+require 'sinatra/test'
+
+Sinatra::Default.set(
+ :environment => :test,
+ :run => false,
+ :raise_errors => true,
+ :logging => false
+)
+
+class Sinatra::Base
+ # Allow assertions in request context
+ include Test::Unit::Assertions
+end
+
+class Test::Unit::TestCase
+ include Sinatra::Test
-module Sinatra::Test
# Sets up a Sinatra::Base subclass defined with the block
# given. Used in setup or individual spec methods to establish
# the application.
@@ -20,11 +34,6 @@ def mock_app(base=Sinatra::Base, &block)
end
end
-class Sinatra::Base
- # Allow assertions in request context
- include Test::Unit::Assertions
-end
-
##
# test/spec/mini
# http://pastie.caboo.se/158871

0 comments on commit f9b13ee

Please sign in to comment.