diff --git a/Gemfile b/Gemfile index fcab7b64..8c5e9a85 100644 --- a/Gemfile +++ b/Gemfile @@ -62,7 +62,7 @@ group :development do gem 'spring-commands-rspec' gem 'yui-compressor', require: 'yui/compressor' gem 'guard' - gem 'guard-spork' + gem 'guard-spring' gem 'guard-rspec' end @@ -91,6 +91,4 @@ group :test, :development do # FactoryGirl gem 'factory_girl_rails' - # Spork - gem 'spork' -end +end \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 5754c81e..3bb641f8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -68,8 +68,6 @@ GEM xpath (~> 2.0) celluloid (0.15.2) timers (~> 1.1.0) - childprocess (0.4.0) - ffi (~> 1.0, >= 1.0.11) coderay (1.1.0) coffee-rails (4.0.1) coffee-script (>= 2.2.0) @@ -119,10 +117,9 @@ GEM guard-rspec (4.2.4) guard (~> 2.1) rspec (>= 2.14, < 4.0) - guard-spork (1.5.1) - childprocess (>= 0.2.3) - guard (>= 1.1) - spork (>= 0.8.4) + guard-spring (0.0.4) + guard + spring highline (1.6.20) hike (1.2.3) hiredis (0.4.5) @@ -246,7 +243,6 @@ GEM simplecov-html (~> 0.8.0) simplecov-html (0.8.0) slop (3.4.7) - spork (0.9.2) spring (1.1.0) spring-commands-rspec (1.0.1) spring (>= 0.9.1) @@ -324,7 +320,7 @@ DEPENDENCIES fuubar guard guard-rspec - guard-spork + guard-spring hiredis (~> 0.4.5) jquery-rails json @@ -348,7 +344,6 @@ DEPENDENCIES sass-rails (~> 4.0.0) shoulda-matchers simplecov - spork spring spring-commands-rspec sqlite3 diff --git a/Guardfile b/Guardfile index 1473e891..b03da9ec 100644 --- a/Guardfile +++ b/Guardfile @@ -23,15 +23,3 @@ guard :rspec do watch(%r{^spec/acceptance/(.+)\.feature$}) watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } end - - -guard 'spork', test_unit: false, cucumber: false, rspec_env: { 'RAILS_ENV' => 'test' } do - watch('config/application.rb') - watch('config/environment.rb') - watch('config/environments/test.rb') - watch(%r{^config/initializers/.+\.rb$}) - watch('Gemfile.lock') - watch('spec/spec_helper.rb') { :rspec } - watch('test/test_helper.rb') { :test_unit } - watch(%r{features/support/}) { :cucumber } -end diff --git a/bin/rails b/bin/rails index 657440d2..728cd85a 100755 --- a/bin/rails +++ b/bin/rails @@ -1,16 +1,4 @@ #!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'rails' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('railties', 'rails') +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake index 26c7a2d5..17240489 100755 --- a/bin/rake +++ b/bin/rake @@ -1,16 +1,4 @@ #!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'rake' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('rake', 'rake') +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e4560fc9..820a1236 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,93 +1,70 @@ -require 'rubygems' -require 'spork' - -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. +ENV["RAILS_ENV"] = 'test' - unless ENV['DRB'] - require 'simplecov' +require 'rubygems' +require 'simplecov' +require File.expand_path("../../config/environment", __FILE__) +require 'rspec/rails' +require 'rspec/autorun' +#require 'sunspot/rails/spec_helper' + +$original_sunspot_session = Sunspot.session +Sunspot::Rails::Tester.start_original_sunspot_session + +# 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| load f} + +Sugar.redis = Redis.connect(RedisHelper::CONFIG) + +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" + + # Stub Sunspot + config.before do + Sunspot.session = Sunspot::Rails::StubSessionProxy.new($original_sunspot_session) end - - ENV["RAILS_ENV"] = 'test' - - require File.expand_path("../../config/environment", __FILE__) - require 'rspec/rails' - require 'rspec/autorun' - #require 'sunspot/rails/spec_helper' - - $original_sunspot_session = Sunspot.session - Sunspot::Rails::Tester.start_original_sunspot_session - - 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" - - # Stub Sunspot - config.before do - Sunspot.session = Sunspot::Rails::StubSessionProxy.new($original_sunspot_session) - end - config.before :each, solr: true do - Sunspot::Rails::Tester.start_original_sunspot_session - Sunspot.session = $original_sunspot_session - Sunspot.remove_all! - end - - # Use FactoryGirl shorthand - config.include FactoryGirl::Syntax::Methods - - # 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 - - # If true, the base class of anonymous controllers will be inferred - # automatically. This will be the default behavior in future versions of - # rspec-rails. - config.infer_base_class_for_anonymous_controllers = false + config.before :each, solr: true do + Sunspot::Rails::Tester.start_original_sunspot_session + Sunspot.session = $original_sunspot_session + Sunspot.remove_all! end -end + # Use FactoryGirl shorthand + config.include FactoryGirl::Syntax::Methods -Spork.each_run do + # 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 - if ENV['DRB'] - require 'simplecov' - end - - # This code will be run each time you run your specs. + # If true, the base class of anonymous controllers will be inferred + # automatically. This will be the default behavior in future versions of + # rspec-rails. + config.infer_base_class_for_anonymous_controllers = false - # 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| load f} + config.include RedisHelper, redis: true + config.include JsonSpec::Helpers + config.include LoginMacros, type: :controller + config.include MailerMacros + config.include ConfigurationMacros - Sugar.redis = Redis.connect(RedisHelper::CONFIG) + config.before(:each) { reset_email } - RSpec.configure do |config| - config.include RedisHelper, redis: true - config.include JsonSpec::Helpers - config.include LoginMacros, type: :controller - config.include MailerMacros - config.include ConfigurationMacros - config.before(:each) { reset_email } - - # Clean the Redis database and reload the configuration - config.around(:each, redis: true) do |example| - with_clean_redis do - Sugar.config.reset! - example.run - end + # Clean the Redis database and reload the configuration + config.around(:each, redis: true) do |example| + with_clean_redis do + Sugar.config.reset! + example.run end end - end