1
我是Watir,Rspec測試的新手,我剛剛熟悉它。我在互聯網上發現了一個測試,Rspec和watir的組合,但id什麼都沒做。它會拋出錯誤,要求'spec'不存在。我已經安裝了rspec 2.12。我在這裏錯過了什麼,我是否需要安裝一些東西? Rspec腳本的工作和watir一樣好,但是這種組合不是。Watir和Rspec腳本什麼都不做
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
謝謝你的回答,我用ruby file_name.rb運行它。 rspec file_name.rb解決了我的問題。再次感謝 –