

rspec 跳过指定测试
source link: https://blog.yxwang.me/2011/11/skip-specs-by-tags/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

rspec 跳过指定测试
Sun, Nov 20, 2011 • Programming
有些测试比较耗时间,而且很少被修改,如果能在测试的时候跳过它们就能让 spec 快不少。
跳过测试的方法很简单,spec 的 describe 方法可以给对应的测试加上标签,例如
describe SalesController, :slow => true do
# specs
end
接下来只要在 spec/spec_helper.rb 中声明跳过这个标签即可:
RSpec.configure do |config|
config.filter_run_excluding :slow => true
end
与 filter_run_excluding 相反的是 filter_run,指定会被运行的标签,不包含在这个列表中的测试将被忽略。
Recommend
-
88
YouTube的可跳过广告,优酷、爱奇艺们为啥学不来?虎嗅注:本文转自微信公众号“卫夕聊广告”(ID:weixiads),原标题《
-
159
YouTube的可跳过广告,优酷、爱奇艺们为啥学不来?
-
45
-
82
-
46
“我帮您跳过广告”
-
53
-
57
新华社北京8月4日电 新闻分析:6G能“跳过”5G发展吗 新华社记者彭茜 今年以来,韩国、日本等相继发布对第六代移动通信技术(6G)的展望,力图在6G领域加快布局。学界预测,6G在多项关键指标上比5G...
-
8
安卓黑科技工具--自动跳过广告
-
16
教程:如何跳过手机验证,注册谷歌账号/Gmail 2018-12-18 现在注册谷歌账号时,都需要手机号来验证。这里简单介绍避开绑定手机账号的注册流程。 注册谷歌账号为何需要验证手机号? 根据...
-
12
“跳过更新”还得付费?Docker 新变化引发群嘲 2 整理 | 郑丽媛 出品 | CSDN(ID:CSDNnews) 提问:常用软件推出了新版本,你更不更新? 相信有不少人喜欢保证自己所使用的的软件处于最新版本...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK