"Fossies" - the Fresh Open Source Software Archive 
Member "vagrant-2.2.14/test/unit/plugins/provisioners/ansible/cap/guest/suse/ansible_install_test.rb" (20 Nov 2020, 1216 Bytes) of package /linux/misc/vagrant-2.2.14.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 require_relative "../../../../../../base"
2 require_relative "../shared/pip_ansible_install_examples"
3
4
5 require Vagrant.source_root.join("plugins/provisioners/ansible/cap/guest/suse/ansible_install")
6
7
8 describe VagrantPlugins::Ansible::Cap::Guest::SUSE::AnsibleInstall do
9 include_context "unit"
10
11 subject { VagrantPlugins::Ansible::Cap::Guest::SUSE::AnsibleInstall }
12
13 let(:iso_env) do
14 # We have to create a Vagrantfile so there is a root path
15 env = isolated_environment
16 env.vagrantfile("")
17 env.create_vagrant_env
18 end
19
20 let(:machine) { iso_env.machine(iso_env.machine_names[0], :dummy) }
21 let(:communicator) { double("comm") }
22
23 before do
24 allow(machine).to receive(:communicate).and_return(communicator)
25 allow(communicator).to receive(:execute).and_return(true)
26 end
27
28 describe "#ansible_install" do
29
30 it_behaves_like "Ansible setup via pip is not implemented"
31
32 describe "when install_mode is :default (or unknown)" do
33 it "installs ansible with 'zypper' package manager" do
34 expect(communicator).to receive(:sudo).with("zypper --non-interactive --quiet install ansible")
35
36 subject.ansible_install(machine, :default, "", "", "")
37 end
38 end
39 end
40
41 end