From f6a0861c408ca44aec872b511cbb9dca1b3b1253 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 9 Nov 2016 16:29:23 -0800 Subject: [PATCH] Add stub test for salt provisioner --- .../provisioners/salt/provisioner_test.rb | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/unit/plugins/provisioners/salt/provisioner_test.rb diff --git a/test/unit/plugins/provisioners/salt/provisioner_test.rb b/test/unit/plugins/provisioners/salt/provisioner_test.rb new file mode 100644 index 000000000..93ce44a87 --- /dev/null +++ b/test/unit/plugins/provisioners/salt/provisioner_test.rb @@ -0,0 +1,35 @@ +require_relative "../../../base" + +require Vagrant.source_root.join("plugins/provisioners/salt/provisioner") + +describe VagrantPlugins::Salt::Provisioner do + include_context "unit" + + subject { described_class.new(machine, config) } + + let(:iso_env) do + # We have to create a Vagrantfile so there is a root path + env = isolated_environment + env.vagrantfile("") + env.create_vagrant_env + end + + let(:machine) { iso_env.machine(iso_env.machine_names[0], :dummy) } + let(:config) { double("config") } + let(:communicator) { double("comm") } + let(:guest) { double("guest") } + + before do + machine.stub(communicate: communicator) + machine.stub(guest: guest) + + communicator.stub(execute: true) + communicator.stub(upload: true) + + guest.stub(capability?: false) + end + + describe "#provision" do + + end +end