ActiveRecord 与 Ruby、Rails、Cucumber 的依赖关系 规格

发布于 2024-07-27 00:49:31 字数 350 浏览 1 评论 0原文

我们正在编写一个使用 CouchDB 作为数据存储的 Rails 应用程序。 我们使用 RSpec 和 Cucumber 进行 BDD/TDD,它使用 WebRat 进行网页测试

我试图将 ActiveRecord 作为 Rails 加载的资源之一删除,但它导致 Cucumber 测试失败。 我已经删除了我能找到的所有引用(固定装置、环境文件等),但没有它它仍然会失败。

有人见过这个吗? 应用程序可以正常运行,但测试却不能。

编辑

我确实删除了 env 文件中的框架,还删除了所有事务固定代码。 我们正在使用最新版本的 rspec 和 rspec-rails。

We are writing a Rails application that is using CouchDB as its data store. We're BDD/TDD'ing with RSpec and Cucumber, which is using WebRat for webpage testing

I'm trying to remove ActiveRecord as one of the resources that is being loaded by rails but its causing the cucumber tests to fail. I've removed all references that I can find (fixtures, environment files, etc...) but it still fails without it.

Has anyone seen this? The application runs fine without, but the test don't.

edit

I did remove the framework in env file, I also removed all the transactional fixture code. We're using the latest version of rspec and rspec-rails.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

阳光下的泡沫是彩色的 2024-08-03 00:49:31

首先解决问题。
我确实需要更多信息,但是...

假设您已在 config/environment.rb: 中完成此操作

  # Skip frameworks you're not going to use. To use Rails without a database
  # you must remove the Active Record framework.
  config.frameworks -= [ :active_record ]

并且正在使用 rspec-rails 1.2.6,您将收到类似 uninitializedconstant Spec::Matchers 的错误::更改::ActiveRecord
这是在 ticket #810 中提出的。 该问题已在两周前发布的 1.2.7 中修复。

如果这不是您的问题,您能否发布您遇到的错误以及有关您的测试环境的更多信息?

First stab at the problem.
Really I need a little more information, but...

Assuming you have done this in config/environment.rb:

  # Skip frameworks you're not going to use. To use Rails without a database
  # you must remove the Active Record framework.
  config.frameworks -= [ :active_record ]

and are using rspec-rails 1.2.6, you would be getting an error like uninitialized constant Spec::Matchers::Change::ActiveRecord
which was brought up in ticket #810. It was fixed for 1.2.7, which was released only two weeks ago.

If that turns out not to be your problem, could you post the errors you've been getting and maybe some more information about your test environment?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文