Permalink
Browse files

Upgraded to work with the latest Riot and stuff

  • Loading branch information...
1 parent 33322c5 commit 7cffcdb906b3ad2f4250f5d915d2ea3337eff55d @gus gus committed Nov 22, 2009
View
@@ -10,14 +10,14 @@ task(:set_test_env) { ENV['RACK_ENV'] ||= 'test' }
desc "Run all tests"
Rake::TestTask.new("test") do |t|
t.libs.concat ['./lib', './test']
- t.test_files = FileList['test/*_test.rb']
+ t.test_files = FileList['test/riot_tests/*_test.rb']
t.verbose = true
end
task "test:shoulda" => [:set_test_env]
desc "Run all Shoulda based tests"
Rake::TestTask.new("test:shoulda") do |t|
- t.libs << "test/shoulda_tests"
+ t.libs.concat ['./lib', './test']
t.test_files = FileList['test/shoulda_tests/*_test.rb']
t.verbose = true
end
View
@@ -12,6 +12,7 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--main", "README.markdown"]
s.extra_rdoc_files = ["README.markdown"]
s.add_development_dependency "riot"
+ s.add_development_dependency "rack-test"
# run git ls-files to get an updated list
s.files = %w[
@@ -1,4 +1,4 @@
-require 'test_helper'
+require 'riot_tests/test_helper'
context "Application Test:" do
@@ -1,4 +1,4 @@
-require 'test_helper'
+require 'riot_tests/test_helper'
context "Helpers Test:" do
setup do
@@ -1,4 +1,4 @@
-require 'test_helper'
+require 'riot_tests/test_helper'
context "Responders Test:" do
setup do
@@ -1,4 +1,4 @@
-require 'test_helper'
+require 'riot_tests/test_helper'
context "Riot Macros Test:" do
setup do
@@ -1,11 +1,9 @@
-%w[ rubygems riot haml sass chicago sinatra/test chicago/riot ].each do |lib|
+%w[ rubygems riot haml sass chicago rack/test chicago/riot ].each do |lib|
require lib
end
class Riot::Situation
- include Sinatra::Test
-
- alias_method :last_response, :response
+ include Rack::Test::Methods
# Sets up a Sinatra::Base subclass defined with the block
# given. Used in setup or individual spec methods to establish
@@ -1,4 +1,4 @@
-require 'test_helper'
+require 'shoulda_tests/test_helper'
class ApplicationTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require 'test_helper'
+require 'shoulda_tests/test_helper'
class HelpersTest < Test::Unit::TestCase
def app
@@ -1,4 +1,4 @@
-require 'test_helper'
+require 'shoulda_tests/test_helper'
class RespondersTest < Test::Unit::TestCase
def app
@@ -1,8 +1,10 @@
-%w[ rubygems test/unit shoulda haml sass chicago sinatra/test chicago/shoulda ].each do |lib|
+%w[ rubygems test/unit shoulda haml sass chicago rack/test chicago/shoulda ].each do |lib|
require lib
end
-module Sinatra::Test
+class Test::Unit::TestCase
+ include Rack::Test::Methods
+
# Sets up a Sinatra::Base subclass defined with the block
# given. Used in setup or individual spec methods to establish
# the application.
@@ -11,12 +13,7 @@ def mock_app(base=Sinatra::Base, &block)
end
def extend_mock_app(&block)
+ @_rack_test_session ||= Rack::Test::Session.new(app)
@app.instance_eval(&block)
end
end
-
-class Test::Unit::TestCase
- include Sinatra::Test
-
- alias_method :last_response, :response
-end

0 comments on commit 7cffcdb

Please sign in to comment.