|
24 | 24 | end
|
25 | 25 |
|
26 | 26 | RSpec.describe PuppetLitmus::RakeHelper do
|
| 27 | + inventory_file = File.join(Dir.pwd, 'spec', 'fixtures', 'litmus_inventory.yaml') |
| 28 | + let(:inventory_file) { inventory_file } |
| 29 | + |
27 | 30 | context 'with provision_list' do
|
28 | 31 | let(:provision_hash) { { 'default' => { 'provisioner' => 'docker', 'images' => ['waffleimage/centos7'] } } }
|
29 | 32 | let(:results) { [] }
|
|
42 | 45 | inventory_vars: nil,
|
43 | 46 | provision_hash: { 'default' => { 'provisioner' => 'docker', 'images' => ['waffleimage/centos7'] } },
|
44 | 47 | results: [],
|
45 |
| - params: { 'action' => 'provision', 'platform' => 'waffleimage/centos7', 'inventory' => Dir.pwd } |
| 48 | + params: { 'action' => 'provision', 'platform' => 'waffleimage/centos7', 'inventory' => inventory_file } |
46 | 49 | },
|
47 | 50 | {
|
48 | 51 | provisioner: 'vagrant',
|
49 | 52 | platform: 'centos7',
|
50 | 53 | inventory_vars: nil,
|
51 | 54 | provision_hash: { 'default' => { 'provisioner' => 'vagrant', 'images' => ['centos7'] } },
|
52 | 55 | results: [],
|
53 |
| - params: { 'action' => 'provision', 'platform' => 'centos7', 'inventory' => Dir.pwd } |
| 56 | + params: { 'action' => 'provision', 'platform' => 'centos7', 'inventory' => inventory_file } |
54 | 57 | }
|
55 | 58 | ].freeze
|
56 | 59 |
|
|
68 | 71 | [{ 'uri' => 'some.host', 'facts' => { 'provisioner' => 'docker', 'container_name' => 'foo', 'platform' => 'some.host' } }] }] }
|
69 | 72 | end
|
70 | 73 | let(:targets) { ['some.host'] }
|
71 |
| - let(:params) { { 'action' => 'tear_down', 'node_name' => 'some.host', 'inventory' => Dir.pwd } } |
| 74 | + let(:params) { { 'action' => 'tear_down', 'node_name' => 'some.host', 'inventory' => inventory_file } } |
72 | 75 |
|
73 | 76 | it 'calls function' do
|
74 | 77 | allow(File).to receive(:directory?).with(File.join(described_class::DEFAULT_CONFIG_DATA['modulepath'], 'provision')).and_return(true)
|
|
89 | 92 | ] }] }
|
90 | 93 | end
|
91 | 94 | let(:targets) { ['one.host'] }
|
92 |
| - let(:params) { { 'action' => 'tear_down', 'node_name' => 'one.host', 'inventory' => Dir.pwd } } |
| 95 | + let(:params) { { 'action' => 'tear_down', 'node_name' => 'one.host', 'inventory' => inventory_file } } |
93 | 96 |
|
94 | 97 | it 'calls function' do
|
95 | 98 | allow(File).to receive(:directory?).with(File.join(described_class::DEFAULT_CONFIG_DATA['modulepath'], 'provision')).and_return(true)
|
|
0 commit comments