Using spork with watchr and all that jazz... though still not feeling like the tests are "blazingly fast" (sigh)

cat-town
Dan Buch 13 years ago
parent 99b84ea0c9
commit d727621c46

@ -1 +1 @@
--colour
--colour --drb

@ -36,5 +36,5 @@ group :development, :test do
gem 'rspec-rails'
gem 'watchr'
gem 'rev'
gem 'spork'
gem 'spork', '~> 0.9.0.rc'
end

@ -105,6 +105,7 @@ GEM
sass (>= 3.1.4)
sprockets (~> 2.0.0)
tilt (~> 1.3.2)
spork (0.9.0.rc9)
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
@ -132,6 +133,7 @@ DEPENDENCIES
rev
rspec-rails
sass-rails (~> 3.1.4)
spork (~> 0.9.0.rc)
sqlite3
uglifier (>= 1.0.3)
watchr

@ -1,3 +1,2 @@
class Person < ActiveRecord::Base
end

@ -50,5 +50,11 @@ module Gerbil
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
if Rails.env.test?
initializer :after => :initialize_dependency_mechanism do
ActiveSupport::Dependencies.mechanism = :load
end
end
end
end

@ -5,7 +5,7 @@ Gerbil::Application.configure do
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
config.cache_classes = false
# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true

@ -1,3 +1,6 @@
require 'spork'
Spork.prefork do
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
@ -30,4 +33,12 @@ RSpec.configure do |config|
# automatically. This will be the default behavior in future versions of
# rspec-rails.
config.infer_base_class_for_anonymous_controllers = false
ActiveSupport::Dependencies.clear
end
end
Spork.each_run do
load Rails.root.join("config/routes.rb")
Dir[Rails.root.join("app/**/*.rb")].each { |f| load f }
end

Loading…
Cancel
Save