使用bundle exec rspec spec时如何运行rspec标记的测试?

使用bundle exec rspec spec时如何运行rspec标记的测试?,rspec,tags,Rspec,Tags,当我想要运行标记的测试时,我使用 rspec spec --tag smoke_test_not_present 我的系统中有一个关于旧宝石的错误。一个常见的错误 列出并通常有效的解决方案是使用bundle exec 我想运行标记的测试 因此,我: bundle exec rspec spec --tag smoke_test_not_present_this_does_not_exist 但是所有的测试都会运行,不管我引用的(不存在的)标记是什么 我得到: $ bundle exec rs

当我想要运行标记的测试时,我使用

rspec spec --tag smoke_test_not_present
我的系统中有一个关于旧宝石的错误。一个常见的错误

列出并通常有效的解决方案是使用
bundle exec

我想运行标记的测试

因此,我:

bundle exec rspec spec --tag smoke_test_not_present_this_does_not_exist
但是所有的测试都会运行,不管我引用的(不存在的)标记是什么

我得到:

$ bundle exec rspec spec --tag smoke_test_not_present_this_does_not_exist

Run options: include {:focus=>true, :smoke_test_not_present=>true}

All examples were filtered out; ignoring {:focus=>true, :smoke_test_not_present=>true}
.......................^C
Exiting... Interrupt again to exit immediately.

答案是我有:

config.filter_run focus: true
config.run_all_when_everything_filtered = true
在spec_helper.rb中