Added test to expect host vars being inserted into inventory.
This commit is contained in:
parent
78766ded4e
commit
a5dd61c450
|
@ -30,6 +30,7 @@ describe VagrantPlugins::Ansible::Config::Host do
|
|||
galaxy_roles_path
|
||||
groups
|
||||
host_key_checking
|
||||
host_vars
|
||||
inventory_path
|
||||
limit
|
||||
playbook
|
||||
|
@ -62,6 +63,7 @@ describe VagrantPlugins::Ansible::Config::Host do
|
|||
expect(subject.tags).to be_nil
|
||||
expect(subject.skip_tags).to be_nil
|
||||
expect(subject.start_at_task).to be_nil
|
||||
expect(subject.host_vars).to eq({})
|
||||
expect(subject.groups).to eq({})
|
||||
expect(subject.host_key_checking).to be_false
|
||||
expect(subject.raw_arguments).to be_nil
|
||||
|
|
|
@ -234,6 +234,20 @@ VF
|
|||
end
|
||||
end
|
||||
|
||||
describe "with host_vars option" do
|
||||
it_should_create_and_use_generated_inventory
|
||||
|
||||
it "adds host variables to the generated inventory" do
|
||||
config.host_vars = {
|
||||
machine.name => {"http_port" => 80, "maxRequestsPerChild" => 808}
|
||||
}
|
||||
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
||||
inventory_content = File.read(generated_inventory_file)
|
||||
expect(inventory_content).to match("^" + Regexp.quote(machine.name) + ".+http_port=80 maxRequestsPerChild=808")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
describe "with groups option" do
|
||||
it_should_create_and_use_generated_inventory
|
||||
|
||||
|
|
Loading…
Reference in New Issue