Ruby 中的 Selenium-Webdriver 和 minitest。如何 运行 文件中的特定测试用例

Selenium-Webdriver in Ruby with minitest. How to run specific test case inside a file

我正在从Rspec过渡到minitest,以测试后面的比较速度和并行性、维护等

在 Rspec 中,我可以使用以下命令 运行 我的测试用例:

rspec path/to/test/suite.rb -e 'Should test this case'

'Should test this case' 是 suite.rb 文件中的这一行:

it 'Should test this case' do
    ...
end

但我似乎无法在 minitest 中找到任何方法来做到这一点。

不仅可以运行单独测试,还可以使用正则表达式

$ ruby path/to/test/suite.rb --name /Should test this case/