Sha256: 7d5493ad395f1d9927ddb7965775d84d0fdfc60d5ce3ab87bd3d2108e133fb35
Contents?: true
Size: 1.53 KB
Versions: 101
Compression:
Stored size: 1.53 KB
Contents
require "test_helper" class BSDHostTest < Test::Unit::TestCase setup do @klass = Vagrant::Hosts::BSD @env = vagrant_env @instance = @klass.new(@env.vms.values.first.env) end context "supporting nfs check" do should "support NFS" do @instance.expects(:system).returns(true) assert @instance.nfs? end should "not support NFS if nfsd is not found" do @instance.expects(:system).returns(false) assert !@instance.nfs? end should "retry until a boolean is returned" do seq = sequence("seq") @instance.expects(:system).in_sequence(seq).raises(TypeError.new("foo")) @instance.expects(:system).in_sequence(seq).returns(true) assert @instance.nfs? end end context "nfs export" do setup do @instance.stubs(:system) @ip = "foo" @folders = "bar" end should "output the lines of the rendered template" do output = %W[foo bar baz].join("\n") Vagrant::Util::TemplateRenderer.expects(:render).with("nfs/exports", :uuid => @instance.env.vm.uuid, :ip => @ip, :folders => @folders).returns(output) @instance.expects(:system).times(output.split("\n").length) @instance.expects(:system).with("sudo nfsd restart") @instance.nfs_export(@ip, @folders) end end context "nfs cleanup" do # TODO: How to test all the system calls? end end
Version data entries
101 entries across 101 versions & 9 rubygems