Permalink
Browse files

Tests for selenium driver exit codes. #463

  • Loading branch information...
1 parent 5f4c537 commit 8d0442073d4fef8740a324d42e5342b3dfd54c0c @ebeigarts ebeigarts committed Aug 22, 2011
@@ -26,4 +26,25 @@
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
@@ -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
@@ -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

0 comments on commit 8d04420

Please sign in to comment.