Rescue TypeError when checking for NFS and return false [closes GH-109]
This commit is contained in:
parent
1bfb99d606
commit
7e9b75f939
|
@ -7,6 +7,8 @@ module Vagrant
|
|||
def nfs?
|
||||
system("which nfsd")
|
||||
$?.to_i == 0
|
||||
rescue TypeError
|
||||
false
|
||||
end
|
||||
|
||||
def nfs_export(ip, folders)
|
||||
|
|
|
@ -26,6 +26,11 @@ class BSDHostTest < Test::Unit::TestCase
|
|||
|
||||
assert !@instance.nfs?
|
||||
end
|
||||
|
||||
should "not support NFS if an error is raised" do
|
||||
@instance.expects(:system).raises(TypeError.new("foo"))
|
||||
assert !@instance.nfs?
|
||||
end
|
||||
end
|
||||
|
||||
context "nfs export" do
|
||||
|
|
Loading…
Reference in New Issue