Watir 和 Rspec 脚本什么都不做

  • 本文关键字:Rspec 脚本 Watir watir
  • 更新时间 :
  • 英文 :


我是瓦蒂尔的新人,Rspec测试,我只是熟悉它。我在互联网上找到了一个测试,Rspec和watir的组合,但id什么也没做。它抛出错误要求"规范"不存在。我安装了 rspec 2.12。我在这里错过了什么,我需要安装一些东西吗?Rspec 脚本和 watir 一样工作,但这种组合不能。

require 'watir'
require 'spec'
describe "Google" do
  before :all do
    @browser = Watir::Browser.new
    @browser.goto "http://google.com"
  end
  it "has word 'Google' on main page" do
    @browser.text.should include("Google")
  end
  it "has word 'Bing' as it's title" do
    @browser.title.should == "Bing"
  end
  after :all do
    @browser.close
  end
end
"

我在互联网上找到了一个测试"没有帮助。请提供该页面的链接。

另外,您没有说明如何运行脚本。据我所知,要运行 RSpec 1.x 脚本,您必须执行spec file_name.rb,而使用 RSpec 2.x 您必须执行rspec file_name.rb 。这可能是问题所在。

最新更新