Guard + Zeus + Rspec-Rails:Rspec:Module 的未定义方法“配置" [英] Guard + Zeus + Rspec-Rails: undefined method 'configure' for Rspec:Module

查看:44
本文介绍了Guard + Zeus + Rspec-Rails:Rspec:Module 的未定义方法“配置"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下内容:

Rails 4.1.1
guard-zeus 2.0.0
rspec-rails 3.0.1

开箱即用的默认rails g rspec:installguard init

当我运行 guard 并保存规范文件时,出现错误:

When I run guard and save a spec file, I get the error:

undefined method `configure` for RSpec:Module (NoMethodError)

我可以用 rspec specrake 运行规范就好了.

I can run specs with rspec spec and rake just fine.

spec_helper 中,如果我在配置块之前require 'rspec/rails,守卫工作正常,但随后 rspec spec 失败并出现错误:

In spec_helper, if I require 'rspec/rails before the configure block, guard works fine, but then rspec spec fails with the error:

uninitialized constant ActiveSupport::Autoload (NameError)

我猜现在 rails_helperspec_helper 的加载顺序有问题是分开的.

I'm guessing there's a problem with load order now that rails_helper and spec_helper are separated.

两个问题:

  1. 我该如何解决这个问题?
  2. 是否有不同的本地持续集成解决方案,您可以推荐它适用于最新的 Rails 和 Rspec.
  1. How can I fix this?
  2. Is there a different solution for continuous integration locally that you can recommend that works with latest Rails and Rspec.

您只需回答一个问题.

推荐答案

以下修复对我有用:

#spec/spec_helper.rb
require 'rspec/core'

这篇关于Guard + Zeus + Rspec-Rails:Rspec:Module 的未定义方法“配置"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆