Rails 3 - 如果我使用RSpec,我可以删除'test'文件夹吗?
问题描述:
虽然试图迁移,我不断收到此错误:Rails 3 - 如果我使用RSpec,我可以删除'test'文件夹吗?
rake aborted!
test-unit is not part of the bundle. Add it to Gemfile.
如果我使用RSpec的,可我只是删除test文件夹干脆?
答
这个错误意味着你的项目中有一个require test-unit
而没有在Gemfile
中指定它。
所以你其实应该设法找到这一声明,并删除它来修复这个错误(或添加依赖到Gemfile中 - 但听起来倒退,如果你不使用它一点)。
无论如何:如果您使用的是rspec
,您肯定可以删除test
文件夹。
答
我相信是的。 Rspec只应该在../spec/*中寻找测试
答
是的,您可以删除测试文件夹。
如果你想测试单元,但(由于其他宝石依赖)这里是如何安装的测试单元作为宝石:
-
添加宝石的Gemfile
gem 'test-unit'
-
检查宝石
bundle check
您的Gemfile的依赖关系无法满足 安装缺少的宝石,
bundle install
-
安装
bundle install
应该是好去。
另请参阅:http://stackoverflow.com/questions/5072662/how-to-remove-unit-test-and-replace-it-with-rspec – 2012-06-23 20:17:52