对于 RSpec 和 Cucumber,为什么首选在环境文件中指定 :lib => false - 然后在 spec_helper.rb 和 env.rb 中显式要求 gem?
最佳答案
最新的 spec_helper.rb 没有明确要求它们。确保升级到最新的 gem 。
这是来自 The RSpec Book .
We use lib => false for rspec and rspec-rails because even though we may want rails’ gem configuration to help us with installing and bundling gems, we want rspec-rails’ rake tasks to control when they are loaded.
基本上,您希望 Rails 和所有 gem rake 任务仍然有效,但您希望 RSpec 在加载它们时进行处理,以确保您不会多次包含这些内容。
希望对您有所帮助!测试愉快!
肯特
关于ruby-on-rails - 测试和 cucumber 环境中的 Config.gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1973462/