Skip to content

Commit

Permalink
Removed spork
Browse files Browse the repository at this point in the history
  • Loading branch information
elektronaut committed Apr 9, 2014
1 parent 3567255 commit 6821cff
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 136 deletions.
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -91,6 +91,4 @@ group :test, :development do
# FactoryGirl
gem 'factory_girl_rails'

# Spork
gem 'spork'
end
end
13 changes: 4 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -324,7 +320,7 @@ DEPENDENCIES
fuubar
guard
guard-rspec
guard-spork
guard-spring
hiredis (~> 0.4.5)
jquery-rails
json
Expand All @@ -348,7 +344,6 @@ DEPENDENCIES
sass-rails (~> 4.0.0)
shoulda-matchers
simplecov
spork
spring
spring-commands-rspec
sqlite3
Expand Down
12 changes: 0 additions & 12 deletions Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 3 additions & 15 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -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'
18 changes: 3 additions & 15 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -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
139 changes: 58 additions & 81 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6821cff

Please sign in to comment.