Prechádzať zdrojové kódy

Assert that Firefox binary path must be executable

Daniel Gempesaw 10 rokov pred
rodič
commit
d45b682a0c
1 zmenil súbory, kde vykonal 10 pridanie a 3 odobranie
  1. 10 3
      lib/Selenium/Firefox/Binary.pm

+ 10 - 3
lib/Selenium/Firefox/Binary.pm

@@ -29,15 +29,22 @@ sub _unix_path {
 }
 
 sub path {
+    my $path;
     if ($^O eq 'MSWin32') {
-        return _windows_path();
+        $path =_windows_path();
     }
     elsif ($^O eq 'darwin') {
-        return _darwin_path();
+        $path =_darwin_path();
     }
     else {
-        return _unix_path;
+        $path = _unix_path;
     }
+
+    if (not -x $path) {
+        die $path . ' is not an executable file.';
+    }
+
+    return $path;
 }
 
 1;