请指导如何使用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,或在挂起块中包装assert以等待实现:

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相关问答推荐

使用map DO使用嵌套数组重构对象数组

扫描不带空格的字符串中的单词

Rbenv说未安装已安装的版本

定义Struct时如何指定成员的类型?

应用 ransack 日期字段过滤器后,相同的输出票证重复而不是一张

如何在 Ruby 中正确编写代码?以便它产生正确的输出?

while 语句的主体是块吗?

Ruby 中的 Monad 类似功能

如何在 Ruby 中初始化 Hash 中的数组

在 Ruby 早期转义 .each { } 迭代

Ruby 中的抽象方法

如何仅从 Gemfile 中查看依赖关系树?

Ruby数组限制方法

如何合并 Ruby 哈希

如何在 Ruby 中做标准差?

如何在 Ruby 中向异常消息中添加信息?

Ruby总是Round Up

Ruby 中的 each 和 collect 方法有什么不同

如何在不为 RVM 用户授予 sudo 访问权限的情况下安装 RVM 系统要求

如何编写启动 tmux 会话的 shell 脚本,然后运行 ​​ruby​​ 脚本