|
22 | 22 | expect($stdout).to receive(:puts).with('redhat-5-x86_64')
|
23 | 23 | expect($stdout).to receive(:puts).with('ubuntu-1404-x86_64')
|
24 | 24 | expect($stdout).to receive(:puts).with('ubuntu-1804-x86_64')
|
| 25 | + allow_any_instance_of(Object).to receive(:exit) |
25 | 26 | Rake::Task['litmus:metadata'].invoke
|
26 | 27 | end
|
27 | 28 | end
|
|
44 | 45 |
|
45 | 46 | expect_any_instance_of(Object).to receive(:install_module).with(inventory_hash, target_nodes, dummy_tar, args[:module_repository])
|
46 | 47 | expect($stdout).to receive(:puts).with("Installed '#{dummy_tar}' on #{target_nodes.join(', ')}")
|
47 |
| - |
| 48 | + allow_any_instance_of(Object).to receive(:exit) |
48 | 49 | Rake::Task['litmus:install_module'].invoke(*args.values)
|
49 | 50 | end
|
50 | 51 |
|
|
93 | 94 | expect($stdout).to receive(:puts).with(start_with('Installing \'spec/data/doot.tar.gz\''))
|
94 | 95 | expect_any_instance_of(Object).to receive(:run_command).twice.and_return([])
|
95 | 96 | expect($stdout).to receive(:puts).with(start_with('Installed \'spec/data/doot.tar.gz\''))
|
| 97 | + allow_any_instance_of(Object).to receive(:exit) |
96 | 98 | Rake::Task['litmus:install_modules_from_directory'].invoke('./spec/fixtures/modules')
|
97 | 99 | end
|
98 | 100 | end
|
|
103 | 105 | expect(Rake::Task['litmus:provision_list']).to receive(:invoke).with('default')
|
104 | 106 | expect(Rake::Task['litmus:install_agent']).to receive(:invoke).with('puppet6')
|
105 | 107 | expect(Rake::Task['litmus:install_module']).to receive(:invoke)
|
| 108 | + allow_any_instance_of(Object).to receive(:exit) |
106 | 109 | Rake::Task['litmus:provision_install'].invoke('default', 'puppet6')
|
107 | 110 | end
|
108 | 111 | end
|
|
126 | 129 | allow_any_instance_of(BoltSpec::Run).to receive(:run_task).with(any_args).and_return(results)
|
127 | 130 | allow_any_instance_of(PuppetLitmus::InventoryManipulation).to receive(:inventory_hash_from_inventory_file).with(any_args).and_return({})
|
128 | 131 | allow_any_instance_of(PuppetLitmus::RakeHelper).to receive(:check_connectivity?).with(any_args).and_return(true)
|
129 |
| - |
| 132 | + allow_any_instance_of(Object).to receive(:exit) |
130 | 133 | expect { Rake::Task['litmus:provision'].invoke('docker', 'centos:7') }.to output(/#{expected_output}/).to_stdout
|
131 | 134 | end
|
132 | 135 | end
|
|
138 | 141 | it 'no key in provision file' do
|
139 | 142 | allow(File).to receive(:file?).with(any_args).and_return(true)
|
140 | 143 | expect(YAML).to receive(:load_file).with(provision_file).and_return(provision_hash)
|
| 144 | + allow_any_instance_of(Object).to receive(:exit) |
141 | 145 | expect { Rake::Task['litmus:provision_list'].invoke('deet') }.to raise_error(/deet/)
|
142 | 146 | end
|
143 | 147 | end
|
|
149 | 153 | stub_const('ENV', ENV.to_hash.merge('TARGET_HOST' => 'some.host'))
|
150 | 154 | expect_any_instance_of(PuppetLitmus::InventoryManipulation).to receive(:inventory_hash_from_inventory_file).and_return(inventory_hash)
|
151 | 155 | expect_any_instance_of(PuppetLitmus::RakeHelper).to receive(:check_connectivity?).with(inventory_hash, nil).and_return(true)
|
| 156 | + allow_any_instance_of(Object).to receive(:exit) |
152 | 157 | Rake::Task['litmus:check_connectivity'].invoke
|
153 | 158 | end
|
154 | 159 | end
|
|
157 | 162 | it 'calls spec_prep' do
|
158 | 163 | expect(Rake::Task['spec_prep']).to receive(:invoke).and_return('')
|
159 | 164 | expect_any_instance_of(RSpec::Core::RakeTask).to receive(:run_task)
|
| 165 | + allow_any_instance_of(Object).to receive(:exit) |
160 | 166 | Rake::Task['litmus:acceptance:localhost'].invoke
|
161 | 167 | end
|
162 | 168 | end
|
|
0 commit comments