zeus rspec fails include required files, but rspec alone does fine

北慕城南 提交于 2020-01-12 07:20:11

问题


It's weird issue, zeus start running smoothly.

rspec spec/ does it's job flawless.

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

I have shared contexts in spec/support/shared_contexts.rb (which is normally included). rspec spec/ passed all tests, then zeus rspec spec/ passed all tests and throws inclusion errors like this

`find_and_eval_shared': Could not find shared context "with signed user" (ArgumentError)

It tries to pass zeus rspec spec/models and then throws 'factory_girl' inclusion errors while rspec spec/models do it's job fine.

It appears to look like this issue https://github.com/burke/zeus/issues/175


回答1:


I found this behavior was cause by

 require 'rspec/autotest'

in spec_helper.rb



来源:https://stackoverflow.com/questions/14030561/zeus-rspec-fails-include-required-files-but-rspec-alone-does-fine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!