diff --git a/.rspec b/.rspec index b5b2bad..c731036 100644 --- a/.rspec +++ b/.rspec @@ -1 +1 @@ ---colour -fs +--colour -fs --drb diff --git a/Gemfile b/Gemfile index 4797513..5c1ada4 100644 --- a/Gemfile +++ b/Gemfile @@ -33,8 +33,10 @@ gem 'twitter-auth', # and rake tasks are available in development mode: group :development, :test do gem 'ruby-debug19', :require => 'ruby-debug' - gem 'rspec-rails', '2.0.0.beta.22' + gem 'rspec-rails', '2.0.0' gem 'haml-rails' gem 'g' gem 'factory_girl' + gem 'spork' + gem 'autotest' end diff --git a/Gemfile.lock b/Gemfile.lock index c5e37d9..d8a63b3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -40,6 +40,7 @@ GEM archive-tar-minitar (0.5.2) arel (1.0.1) activesupport (~> 3.0.0) + autotest (4.4.1) bson (1.0.4) bson_ext (1.0.4) builder (2.1.2) @@ -92,18 +93,18 @@ GEM rake (>= 0.8.4) thor (~> 0.14.0) rake (0.8.7) - rspec (2.0.0.beta.22) - rspec-core (= 2.0.0.beta.22) - rspec-expectations (= 2.0.0.beta.22) - rspec-mocks (= 2.0.0.beta.22) - rspec-core (2.0.0.beta.22) - rspec-expectations (2.0.0.beta.22) + rspec (2.0.0) + rspec-core (= 2.0.0) + rspec-expectations (= 2.0.0) + rspec-mocks (= 2.0.0) + rspec-core (2.0.0) + rspec-expectations (2.0.0) diff-lcs (>= 1.1.2) - rspec-mocks (2.0.0.beta.22) - rspec-core (= 2.0.0.beta.22) - rspec-expectations (= 2.0.0.beta.22) - rspec-rails (2.0.0.beta.22) - rspec (= 2.0.0.beta.22) + rspec-mocks (2.0.0) + rspec-core (= 2.0.0) + rspec-expectations (= 2.0.0) + rspec-rails (2.0.0) + rspec (= 2.0.0) ruby-debug-base19 (0.11.24) columnize (>= 0.3.1) linecache19 (>= 0.5.11) @@ -115,6 +116,7 @@ GEM ruby-growl (2.0) ruby_core_source (0.1.4) archive-tar-minitar (>= 0.5.2) + spork (0.8.4) thor (0.14.0) treetop (1.4.8) polyglot (>= 0.3.1) @@ -127,13 +129,15 @@ PLATFORMS ruby DEPENDENCIES + autotest bson_ext (= 1.0.4) factory_girl g haml-rails mongoid (= 2.0.0.beta.18) rails (= 3.0.0) - rspec-rails (= 2.0.0.beta.22) + rspec-rails (= 2.0.0) ruby-debug19 + spork twitter-auth! unicorn diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 81da617..2551d10 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,33 +1,55 @@ -# This file is copied to spec/ when you run 'rails generate rspec:install' -ENV["RAILS_ENV"] ||= 'test' -require File.expand_path("../../config/environment", __FILE__) -require 'rspec/rails' - -# Requires supporting ruby files with custom matchers and macros, etc, -# in spec/support/ and its subdirectories. -Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} - -Mongoid.master.collections.each {|c| c.drop rescue nil} - -RSpec.configure do |config| - # == Mock Framework - # - # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: - # - # config.mock_with :mocha - # config.mock_with :flexmock - # config.mock_with :rr - config.mock_with :rspec - - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - # config.fixture_path = "#{::Rails.root}/spec/fixtures" - - # If you're not using ActiveRecord, or you'd prefer not to run each of your - # examples within a transaction, remove the following line or assign false - # instead of true. - # config.use_transactional_fixtures = true - - config.before do - Mongoid.master.collections.each(&:remove) +require 'rubygems' +require 'spork' + +# --- Instructions --- +# - Sort through your spec_helper file. Place as much environment loading +# code that you don't normally modify during development in the +# Spork.prefork block. +# - Place the rest under Spork.each_run block +# - Any code that is left outside of the blocks will be ran during preforking +# and during each_run! +# - These instructions should self-destruct in 10 seconds. If they don't, +# feel free to delete them. + +Spork.prefork do + # Loading more in this block will cause your tests to run faster. However, + # if you change any configuration or code from libraries loaded here, you'll + # need to restart spork for it take effect. + + # This file is copied to spec/ when you run 'rails generate rspec:install' + ENV["RAILS_ENV"] ||= 'test' + require File.expand_path("../../config/environment", __FILE__) + require 'rspec/rails' + # Requires supporting ruby files with custom matchers and macros, etc, + # in spec/support/ and its subdirectories. + Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} + + Mongoid.master.collections.each {|c| c.drop rescue nil} + + RSpec.configure do |config| + # == Mock Framework + # + # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: + # + # config.mock_with :mocha + # config.mock_with :flexmock + # config.mock_with :rr + config.mock_with :rspec + + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures + # config.fixture_path = "#{::Rails.root}/spec/fixtures" + + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, remove the following line or assign false + # instead of true. + # config.use_transactional_fixtures = true + + config.before do + Mongoid.master.collections.each(&:remove) + end end end + +Spork.each_run do + # This code will be run each time you run your specs. +end