BSD host properly tests for `nfsd` binary

This commit is contained in:
Mitchell Hashimoto 2010-07-12 22:41:41 -07:00
parent ba78ea86c1
commit e158a01d69
2 changed files with 16 additions and 2 deletions

View File

@ -5,8 +5,8 @@ module Vagrant
include Util
def nfs?
# TODO: verify it exists
true
system("which nfsd")
$?.to_i == 0
end
def nfs_export(ip, folders)

View File

@ -10,8 +10,22 @@ class BSDHostTest < Test::Unit::TestCase
context "supporting nfs check" do
should "support NFS" do
@instance.expects(:system).with() do |cmd|
`which which`
true
end
assert @instance.nfs?
end
should "not support NFS if nfsd is not found" do
@instance.expects(:system).with() do |cmd|
`which thisshouldnoteverneverexist`
true
end
assert !@instance.nfs?
end
end
context "nfs export" do