【发布时间】:2020-06-30 01:47:41
【问题描述】:
有谁知道跳过组内的多个示例而不在它们之间重复跳过语句的方法?
例如,给定这个测试:
describe 'some feature' do
it 'should do something' do
...
end
it 'should do something else too' do
...
end
end
skip 如果放在第一个示例之前,则不起作用,如下所示:
describe 'some feature' do
skip 'I would like to skip both with one statement'
it 'should do something' do
...
end
it 'should do something else too' do
...
end
end
一个理想的解决方案将允许我跳过示例结构的任何级别(describe/feature、context 和 scenario/it)并跳过该级别的所有子级层次结构。
换句话说,允许我这样做:
describe 'some feature' do
it 'should do something' do
...
end
it 'should do something else too' do
skip 'just one of these for now'
...
end
end
与
describe 'some feature' do
skip 'everything within this describe block'
it 'should do something' do
...
end
it 'should do something else too' do
...
end
end
也一样
describe 'some feature' do
context 'such and such' do
skip 'just this context'
it 'should do something' do
...
end
it 'should do something else too' do
...
end
it 'but do not skip this one' do
...
end
end
【问题讨论】:
标签: ruby rspec rubygems rspec3