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

This commit is contained in:
Dan Buch 2011-11-14 08:35:09 -05:00
parent 99b84ea0c9
commit d727621c46
7 changed files with 49 additions and 31 deletions

View File

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

View File

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

View File

@ -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

View File

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

View File

@ -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

View File

@ -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

View File

@ -1,14 +1,17 @@
# 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'
require 'rspec/autorun'
require 'spork'
# 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}
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__)
require 'rspec/rails'
require 'rspec/autorun'
RSpec.configure do |config|
# 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}
RSpec.configure do |config|
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
@ -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