浏览代码

Assert that Firefox binary path must be executable

Daniel Gempesaw 10 年之前
父节点
当前提交
d45b682a0c
共有 1 个文件被更改,包括 10 次插入3 次删除
  1. 10 3
      lib/Selenium/Firefox/Binary.pm

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

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