ActiveRecord 与 Ruby、Rails、Cucumber 的依赖关系 规格
我们正在编写一个使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先解决问题。
我确实需要更多信息,但是...
假设您已在 config/environment.rb: 中完成此操作
并且正在使用 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:
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?