diff --git a/lib/vagrant/hosts/bsd.rb b/lib/vagrant/hosts/bsd.rb index 174273992..91e8afd95 100644 --- a/lib/vagrant/hosts/bsd.rb +++ b/lib/vagrant/hosts/bsd.rb @@ -7,6 +7,8 @@ module Vagrant def nfs? system("which nfsd") $?.to_i == 0 + rescue TypeError + false end def nfs_export(ip, folders) diff --git a/test/vagrant/hosts/bsd_test.rb b/test/vagrant/hosts/bsd_test.rb index 4d852cc69..df476de0c 100644 --- a/test/vagrant/hosts/bsd_test.rb +++ b/test/vagrant/hosts/bsd_test.rb @@ -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