ruby-on-rails – zeus rspec失败包括所需的文件,但rspec一个人都行

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – zeus rspec失败包括所需的文件,但rspec一个人都行前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
这是奇怪的问题,宙斯开始顺利运行.

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,然后抛出’factory_girl’包含错误,而rspec spec / models做的工作正常.

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

解决方法

我发现这个行为是由原因造成的
require 'rspec/autotest'

在spec_helper.rb

原文链接:https://www.f2er.com/ruby/266960.html

猜你在找的Ruby相关文章