Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add RSpec.

  • Loading branch information...
commit 298a64820dedd9c734ca1299e6138d2072043c0f 1 parent 79d5f80
@twe4ked authored
Showing with 39 additions and 0 deletions.
  1. +1 −0  .rspec
  2. +4 −0 Gemfile
  3. +10 −0 Gemfile.lock
  4. +24 −0 spec/spec_helper.rb
View
1  .rspec
@@ -0,0 +1 @@
+--color
View
4 Gemfile
@@ -18,3 +18,7 @@ gem 'dm-timestamps'
gem 'dm-migrations'
gem 'dm-validations'
gem 'dm-postgres-adapter'
+
+group :test do
+ gem 'rspec'
+end
View
10 Gemfile.lock
@@ -15,6 +15,7 @@ GEM
daemons (1.1.8)
data_objects (0.10.8)
addressable (~> 2.1)
+ diff-lcs (1.1.3)
dm-core (1.2.0)
addressable (~> 2.2.6)
dm-do-adapter (1.2.0)
@@ -54,6 +55,14 @@ GEM
rack-test (0.6.1)
rack (>= 1.0)
rake (0.9.2.2)
+ rspec (2.10.0)
+ rspec-core (~> 2.10.0)
+ rspec-expectations (~> 2.10.0)
+ rspec-mocks (~> 2.10.0)
+ rspec-core (2.10.0)
+ rspec-expectations (2.10.0)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.10.0)
sass (3.1.16)
simple_oauth (0.1.7)
sinatra (1.3.2)
@@ -96,6 +105,7 @@ DEPENDENCIES
pry
rack-flash3
rake
+ rspec
sass
sinatra
sinatra-reloader
View
24 spec/spec_helper.rb
@@ -0,0 +1,24 @@
+ENV['RACK_ENV'] = 'test'
+
+require 'bundler'
+Bundler.require(:test)
+
+require 'rack/test'
+require './tmpfollow'
+
+Sinatra::Base.set :environment, :test
+Sinatra::Base.set :run, false
+Sinatra::Base.set :raise_errors, true
+Sinatra::Base.set :logging, false
+Sinatra::Base.set :session, false
+
+def app
+ TmpFollow
+end
+
+RSpec.configure do |config|
+ config.include Rack::Test::Methods
+
+ # reset database before each example is run
+ config.before { DataMapper.auto_migrate! }
+end
Please sign in to comment.
Something went wrong with that request. Please try again.