次のspec
サブディレクトリがあるとします。
lib
models
observers
workers
spec_helper.rb ファイルで、rspec に lib サブディレクトリ内のすべての spec ファイルを除外するように指示するにはどうすればよいですか?
Spork.prefork do
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
config.mock_with :rspec
config.use_transactional_fixtures = false
config.before(:suite) do
DatabaseCleaner.clean_with :truncation
DatabaseCleaner.strategy = :transaction
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus => true
end
end
Spork.each_run do
FactoryGirl.reload
end
参考までに-ガードを使用してテストを自動リロードしています。