Removed spork to get spec helper working. Will readd later if required.
This commit is contained in:
parent
769cf7548c
commit
51c0397531
1
Gemfile
1
Gemfile
@ -78,7 +78,6 @@ group :test do
|
|||||||
gem 'capybara'
|
gem 'capybara'
|
||||||
gem 'database_cleaner'
|
gem 'database_cleaner'
|
||||||
|
|
||||||
gem 'spork', '~> 0.9.0.rc'
|
|
||||||
gem 'launchy'
|
gem 'launchy'
|
||||||
gem 'mocha', '0.9.12' # :git => 'git://github.com/floehopper/mocha.git'
|
gem 'mocha', '0.9.12' # :git => 'git://github.com/floehopper/mocha.git'
|
||||||
end
|
end
|
||||||
|
@ -300,7 +300,6 @@ GEM
|
|||||||
ffi (= 1.0.9)
|
ffi (= 1.0.9)
|
||||||
json_pure
|
json_pure
|
||||||
rubyzip
|
rubyzip
|
||||||
spork (0.9.0.rc9)
|
|
||||||
sprockets (2.0.3)
|
sprockets (2.0.3)
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
@ -383,7 +382,6 @@ DEPENDENCIES
|
|||||||
rubyzip
|
rubyzip
|
||||||
sanitize (~> 2.0.3)
|
sanitize (~> 2.0.3)
|
||||||
sass-rails (~> 3.1.4)
|
sass-rails (~> 3.1.4)
|
||||||
spork (~> 0.9.0.rc)
|
|
||||||
tinymce-rails
|
tinymce-rails
|
||||||
uglifier (~> 1.0.4)
|
uglifier (~> 1.0.4)
|
||||||
unicorn
|
unicorn
|
||||||
|
@ -3,9 +3,6 @@ require 'spec_helper'
|
|||||||
describe Locomotive::Liquid::Drops::Contents do
|
describe Locomotive::Liquid::Drops::Contents do
|
||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
# Reload the file (needed for spork)
|
|
||||||
load File.join(Rails.root, 'lib', 'locomotive', 'liquid', 'drops', 'contents.rb')
|
|
||||||
|
|
||||||
@site = FactoryGirl.build(:site)
|
@site = FactoryGirl.build(:site)
|
||||||
@content_type = FactoryGirl.build(:content_type, :site => @site, :slug => 'projects')
|
@content_type = FactoryGirl.build(:content_type, :site => @site, :slug => 'projects')
|
||||||
end
|
end
|
||||||
|
@ -1,59 +1,17 @@
|
|||||||
# Note: if segmentation fault with spork / imagemagick on mac os x, take a look at:
|
ENV["RAILS_ENV"] ||= 'test'
|
||||||
# http://stackoverflow.com/questions/2838307/why-is-this-rmagick-call-generating-a-segmentation-fault
|
|
||||||
|
|
||||||
require 'rubygems'
|
require 'rails/mongoid'
|
||||||
require 'spork'
|
require File.join(File.dirname(__FILE__), 'dummy', 'config', 'environment.rb')
|
||||||
|
require 'rspec/rails'
|
||||||
|
require 'factory_girl'
|
||||||
|
|
||||||
# figure out where we are being loaded from
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
||||||
if $LOADED_FEATURES.grep(/spec\/spec_helper\.rb/).any?
|
# in spec/support/ and its subdirectories.
|
||||||
begin
|
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
||||||
raise "foo"
|
|
||||||
rescue => e
|
|
||||||
puts <<-MSG
|
|
||||||
===================================================
|
|
||||||
It looks like spec_helper.rb has been loaded
|
|
||||||
multiple times. Normalize the require to:
|
|
||||||
|
|
||||||
require "spec/spec_helper"
|
Locomotive.configure_for_test
|
||||||
|
|
||||||
Things like File.join and File.expand_path will
|
RSpec.configure do |config|
|
||||||
cause it to be loaded multiple times.
|
|
||||||
|
|
||||||
Loaded this time from:
|
|
||||||
|
|
||||||
#{e.backtrace.join("\n ")}
|
|
||||||
===================================================
|
|
||||||
MSG
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
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'
|
|
||||||
|
|
||||||
# Avoid preloading models
|
|
||||||
require 'rails/mongoid'
|
|
||||||
Spork.trap_class_method(Rails::Mongoid, :load_models)
|
|
||||||
|
|
||||||
require File.expand_path('../../config/environment', __FILE__)
|
|
||||||
|
|
||||||
require 'rspec/rails'
|
|
||||||
|
|
||||||
require 'factory_girl'
|
|
||||||
Spork.trap_class_method(FactoryGirl, :find_definitions)
|
|
||||||
|
|
||||||
# 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 }
|
|
||||||
|
|
||||||
Locomotive.configure_for_test
|
|
||||||
|
|
||||||
RSpec.configure do |config|
|
|
||||||
|
|
||||||
config.include(Locomotive::RSpec::Matchers)
|
config.include(Locomotive::RSpec::Matchers)
|
||||||
|
|
||||||
@ -80,14 +38,4 @@ Spork.prefork do
|
|||||||
DatabaseCleaner.clean
|
DatabaseCleaner.clean
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
Spork.each_run do
|
|
||||||
# This code will be run each time you run your specs.
|
|
||||||
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
|
||||||
|
|
||||||
# loading ruby file directly breaks the tests
|
|
||||||
# Dir[Rails.root.join('app/models/*.rb')].each { |f| load f }
|
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user