gpt4 book ai didi

ruby - 如何忽略或跳过使用 RSpec 的测试方法?

转载 作者:数据小太阳 更新时间:2023-10-29 06:26:48 24 4
gpt4 key购买 nike

请指导如何使用 RSpec 禁用以下测试方法之一。我正在使用 Selenuim WebDriver + RSpec 组合来运行测试。

require 'rspec'
require 'selenium-webdriver'

describe 'Automation System' do

before(:each) do
###
end

after(:each) do
@driver.quit
end

it 'Test01' do
#positive test case
end

it 'Test02' do
#negative test case
end
end

最佳答案

您可以使用 pending()或将 it 更改为 xit 或将断言包装在待执行 block 中以等待实现:

describe 'Automation System' do

# some code here

it 'Test01' do
pending("is implemented but waiting")
end

it 'Test02' do
# or without message
pending
end

pending do
"string".reverse.should == "gnirts"
end

xit 'Test03' do
true.should be(true)
end
end

关于ruby - 如何忽略或跳过使用 RSpec 的测试方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27288775/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com