zeus rspec失败包括必需的文件,但单独的rspec就可以了

时间:2012-12-25 12:14:16

标签: ruby-on-rails rspec zeus

这是一个奇怪的问题,宙斯开始顺利运行。

rspec spec /它的工作完美无瑕。

My spec_helper config is 
# encoding: UTF-8
require 'rubygems'

# 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 'email_spec'
require 'rspec/autorun'
require 'capybara/rspec'
require 'shoulda-matchers'
require 'shoulda/matchers/integrations/rspec'

Dir["./spec/support/**/*.rb"].sort.each {|f| require f}

RSpec.configure do |config|

  config.include FactoryGirl::Syntax::Methods
  config.include Devise::TestHelpers, type: :controller
  config.include Capybara::DSL, type: :request


  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.mock_with :rspec
  config.use_transactional_fixtures = true
end

我在spec / support / shared_contexts.rb中共享了上下文(通常包括在内)。 rspec spec/通过了所有测试,然后zeus rspec spec/通过了所有测试并抛出包含错误,如此

`find_and_eval_shared':找不到“与签名用户共享上下文”(ArgumentError)

尝试传递zeus rspec spec/models,然后在rspec spec/models完成工作时抛出'factory_girl'包含错误。

看起来似乎是这个问题https://github.com/burke/zeus/issues/175

1 个答案:

答案 0 :(得分:20)

我发现这种行为是由

引起的
 require 'rspec/autotest'

在spec_helper.rb