[英]Run/exclude specs where tag is present
I know I can run specs given some_tag
is value
with --tag some_tag:value
or where tag is added, but doesn't have a value (defaults to true
) with --tag some_tag
. 我知道我可以运行给定的规格
some_tag
是value
与--tag some_tag:value
或标签被添加在那里,但没有一个值(默认为true
用) --tag some_tag
。 I also know I can exclude specs with the above syntax and ~
. 我也知道我可以使用上述语法和
~
排除规范。
How do I run all specs with a tag present/missing? 如何在标签存在/缺失的情况下运行所有规格?
For example: If I have specs marked with slow: :external_service
, slow: :manual_confirmation
or slow: :some_other_reason
(these are just made up names), I want to do something like: 例如:如果我的规格标记有
slow: :external_service
, slow: :manual_confirmation
slow: :some_other_reason
或slow: :some_other_reason
(这些只是由名字组成的),我想执行以下操作:
rspec --tag ~slow
and run all specs that are not slow. 并运行所有不慢的规格。
The above doesn't work since it filters out specs where slow == true
instead of !slow.nil?
上面的方法不起作用,因为它过滤掉了
slow == true
而不是!slow.nil?
:slow, pending_on: :external_service
) :slow, pending_on: :external_service
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.