1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Tests for selenium driver exit codes. #463

This commit is contained in:
Edgars Beigarts 2011-08-22 12:27:45 +03:00
parent 5f4c537ed9
commit 8d0442073d
3 changed files with 37 additions and 0 deletions

View file

@ -26,4 +26,25 @@ describe Capybara::Selenium::Driver do
browser.quit
end
end
describe "exit codes" do
before do
@current_dir = Dir.getwd
Dir.chdir(File.join(File.dirname(__FILE__), '..', '..'))
end
after do
Dir.chdir(@current_dir)
end
it "should have return code 1 when running selenium_driver_rspec_failure.rb" do
`rspec spec/fixtures/selenium_driver_rspec_failure.rb`
$?.exitstatus.should be 1
end
it "should have return code 0 when running selenium_driver_rspec_success.rb" do
`rspec spec/fixtures/selenium_driver_rspec_success.rb`
$?.exitstatus.should be 0
end
end
end

View file

@ -0,0 +1,8 @@
require 'spec_helper'
describe Capybara::Selenium::Driver do
it "should exit with a non-zero exit status when assertion fails" do
browser = Capybara::Selenium::Driver.new(TestApp).browser
true.should == false
end
end

View file

@ -0,0 +1,8 @@
require 'spec_helper'
describe Capybara::Selenium::Driver do
it "should exit with a non-zero exit status when assertion fails" do
browser = Capybara::Selenium::Driver.new(TestApp).browser
true.should == true
end
end