如何排除与特定标签匹配的Rspec测试?

时间:2021-01-15 21:05:40

When running my Rspec tests from the command line, how can I exclude tests matching a specific tag?

从命令行运行Rspec测试时,如何排除与特定标记匹配的测试?

1 个解决方案

#1


13  

Use ~@ with the name of the tag, like this:

使用〜@标记的名称,如下所示:

rspec spec --tag ~@slow

See the docs: https://www.relishapp.com/rspec/rspec-core/docs/command-line/tag-option

请参阅文档:https://www.relishapp.com/rspec/rspec-core/docs/command-line/tag-option

Update

I'm now running my tests on Spork, and it seems as though it ignores this directive. Not sure why.

我现在正在Spork上运行我的测试,似乎它忽略了这个指令。不知道为什么。

#1


13  

Use ~@ with the name of the tag, like this:

使用〜@标记的名称,如下所示:

rspec spec --tag ~@slow

See the docs: https://www.relishapp.com/rspec/rspec-core/docs/command-line/tag-option

请参阅文档:https://www.relishapp.com/rspec/rspec-core/docs/command-line/tag-option

Update

I'm now running my tests on Spork, and it seems as though it ignores this directive. Not sure why.

我现在正在Spork上运行我的测试,似乎它忽略了这个指令。不知道为什么。