Rspec 规格 &耙规格给出不同的结果 [英] Rspec spec & Rake spec gives different result

查看:41
本文介绍了Rspec 规格 &耙规格给出不同的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎是最常见的问题,我有一个应用程序在 rake specrspec 中运行时,输出似乎不同.使用 rspec spec -p 命令时显示 0 个失败消息,而使用 rake spec 时显示很少的错误.

解决方案

当你运行 $ bundle exec rspec # (defaults to spec) 时,./spec 目录被执行.

当您运行 $ bundle exec rake spec 时,您正在从所有 gem 及其依赖项中执行名为 'spec' 的所有 rake 任务.>

此外,执行测试的环境也可能因这些文件而异.不要怀疑您是否面临不同的输出.

This seems to be mostly asked question, I have an application when run in both rake spec and rspec the output seems to be different. When rspec spec -p command is used 0 failures message is displayed while when rake spec is used few errors are displayed.

解决方案

When you run $ bundle exec rspec # (defaults to spec), all the files in the ./spec directory are executed.

When you run $ bundle exec rake spec, you're executing all of the rake tasks named 'spec' from all the gems and from their dependencies.

Also the environment under which tests are executed may vary accordingly to those files. Don't wonder if you face different outputs.

这篇关于Rspec 规格 &耙规格给出不同的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆