Permalink
Browse files

Add RSpec.

  • Loading branch information...
rgraff committed Apr 19, 2010
1 parent a45f06e commit bd1fbf5aa08e1a4cfeb97bba7d14093c0421fea7
Showing with 38 additions and 1 deletion.
  1. +8 −0 Rakefile
  2. +1 −1 app.rb
  3. +14 −0 spec/app_spec.rb
  4. +4 −0 spec/spec.opts
  5. +11 −0 spec/spec_helper.rb
View
@@ -0,0 +1,8 @@
desc "Run those specs"
task :spec do
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
end
end
View
2 app.rb
@@ -2,6 +2,6 @@
require 'sinatra'
require 'config/init'
get '/hi' do
get '/' do
"Hello World!"
end
View
@@ -0,0 +1,14 @@
require File.dirname(__FILE__) + '/spec_helper'
describe "App" do
include Rack::Test::Methods
def app
@app ||= Sinatra::Application
end
it "should respond to /" do
get '/'
last_response.should be_ok
end
end
View
@@ -0,0 +1,4 @@
--colour
--format progress
--loadby mtime
--reverse
View
@@ -0,0 +1,11 @@
require File.join(File.dirname(__FILE__), '..', 'app.rb')
require 'rack/test'
require 'ruby-debug'
require 'spec'
# set test environment
set :environment, :test
set :run, false
set :raise_errors, true
set :logging, false

0 comments on commit bd1fbf5

Please sign in to comment.