Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

because Rack::Test is the new hotness

  • Loading branch information...
commit 9d5496e284c340fcccb9f89cc7df4b4d78715ac0 1 parent d132657
@zapnap authored
Showing with 8 additions and 5 deletions.
  1. +1 −1  Rakefile
  2. +6 −3 spec/application_spec.rb
  3. +1 −1  spec/spec_helper.rb
View
2  Rakefile
@@ -28,7 +28,7 @@ end
namespace :gems do
desc 'Install required gems'
task :install do
- required_gems = %w{ sinatra rspec dm-core dm-validations
+ required_gems = %w{ sinatra rspec rack-test dm-core dm-validations
dm-aggregates haml }
required_gems.each { |required_gem| system "sudo gem install #{required_gem}" }
end
View
9 spec/application_spec.rb
@@ -1,12 +1,15 @@
require "#{File.dirname(__FILE__)}/spec_helper"
describe 'main application' do
- include Sinatra::Test
+ include Rack::Test::Methods
+
+ def app
+ Sinatra::Application.new
+ end
specify 'should show the default index page' do
get '/'
- @response.should be_ok
- @response.body.should match(/Main Page/)
+ last_response.should be_ok
end
specify 'should have more specs' do
View
2  spec/spec_helper.rb
@@ -2,7 +2,7 @@
require 'sinatra'
require 'spec'
require 'spec/interop/test'
-require 'sinatra/test'
+require 'rack/test'
# set test environment
set :environment, :test
Please sign in to comment.
Something went wrong with that request. Please try again.