Skip to content

Instantly share code, notes, and snippets.

@jcockhren
Created October 1, 2015 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcockhren/202909b3bcbc05cd8843 to your computer and use it in GitHub Desktop.
Save jcockhren/202909b3bcbc05cd8843 to your computer and use it in GitHub Desktop.
Base example of provisioner testing for saltstack
require_relative "../../../base"
require Vagrant.source_root.join("plugins/provisioners/salt/config")
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
env = isolated_environment
env.vagrantfile("")
env.create_vagrant_env
end
let(:machine) {iso_env.machine(iso_env.machine_names[0], :dummy)}
let(:config) { VagrantPlugins::Salt::Config.new }
before do
machine.env.stub(active_machine: [[iso_env.machine_names[0], :dummy]])
config.stub(minion_config: 'salt/minion')
config.stub(run_highstate: true)
end
describe "#provision" do
it "should accept installable version from git" do
config.finalize!
vsp = VagrantPlugins::Salt::Provisioner.new(machine, config)
expect { vsp.provision }.not_to raise_error
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment