Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这似乎是最常被问到的问题,我在两者中运行时都有一个应用程序,rake spec并且rspec输出似乎不同。当使用 rspec spec -p 命令时,会显示 0 个失败消息,而当使用 rake spec 时,会显示很少的错误。
rake spec
rspec
运行时$ bundle exec rspec # (defaults to spec),会执行目录中的所有文件./spec。
$ bundle exec rspec # (defaults to spec)
./spec
当您运行时,您正在执行从所有 gem 及其依赖项中$ bundle exec rake spec命名的所有 rake 任务。'spec'
$ bundle exec rake spec
'spec'
此外,执行测试的环境可能会因这些文件而异。不要怀疑您是否面临不同的输出。