RSpec テストを高速化するために spork を使用していますが、実行ごとにフィルター条件をリロードすることができません。config.filter_run_excluding :slow => true
これらのフィルターをブロックに入れるかどうかに関係なく、Spork.each_run
最初に起動したときにのみ読み込まれるように見えますが、これは面倒です。
それらを毎回再解釈させることは可能ですか?
私のspec_helperファイル:
require 'rubygems'
require 'spork'
require 'shoulda/integrations/rspec2'
Spork.prefork do
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'shared/test_macros'
require 'shared/custom_matchers'
require "email_spec"
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
config.mock_with :rspec
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
config.include(TestMacros)
end
end
Spork.each_run do
RSpec.configure do |config|
# THESE ONLY SEEM TO BE INTERPRETED DURING PRE-FORK
config.filter_run_excluding :slow => true
config.filter_run :now => true
end
end