mirror of
https://github.com/puppetlabs/beaker-vmpooler.git
synced 2026-01-26 11:08:40 -05:00
(MAINT) Remove more VsphereHelper references
And minor whitespace cleanup
This commit is contained in:
parent
ce92bfcf19
commit
3918427d66
1 changed files with 4 additions and 8 deletions
|
|
@ -143,14 +143,14 @@ module Beaker
|
||||||
describe "#cleanup" do
|
describe "#cleanup" do
|
||||||
|
|
||||||
it "cleans up hosts in the pool" do
|
it "cleans up hosts in the pool" do
|
||||||
mock_http = MockNet::HTTP.new("host", "port")
|
mock_http = MockNet::HTTP.new( "host", "port" )
|
||||||
vmpooler = Beaker::Vmpooler.new( make_hosts, make_opts )
|
vmpooler = Beaker::Vmpooler.new( make_hosts, make_opts )
|
||||||
vmpooler.provision
|
vmpooler.provision
|
||||||
vm_count = vmpooler.instance_variable_get( :@hosts ).count
|
vm_count = vmpooler.instance_variable_get( :@hosts ).count
|
||||||
|
|
||||||
expect( Net::HTTP ).to receive( :new ).exactly(vm_count).times.and_return( mock_http )
|
expect( Net::HTTP ).to receive( :new ).exactly( vm_count ).times.and_return( mock_http )
|
||||||
expect( mock_http ).to receive( :request ).exactly(vm_count).times
|
expect( mock_http ).to receive( :request ).exactly( vm_count ).times
|
||||||
expect( Net::HTTP::Delete ).to receive( :new ).exactly(vm_count).times
|
expect( Net::HTTP::Delete ).to receive( :new ).exactly( vm_count ).times
|
||||||
expect{ vmpooler.cleanup }.to_not raise_error
|
expect{ vmpooler.cleanup }.to_not raise_error
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -159,10 +159,6 @@ module Beaker
|
||||||
describe Vmpooler do
|
describe Vmpooler do
|
||||||
|
|
||||||
before :each do
|
before :each do
|
||||||
vms = make_hosts()
|
|
||||||
MockVsphereHelper.set_config( fog_file_contents )
|
|
||||||
MockVsphereHelper.set_vms( vms )
|
|
||||||
stub_const( "VsphereHelper", MockVsphereHelper )
|
|
||||||
stub_const( "Net", MockNet )
|
stub_const( "Net", MockNet )
|
||||||
allow( JSON ).to receive( :parse ) do |arg|
|
allow( JSON ).to receive( :parse ) do |arg|
|
||||||
arg
|
arg
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue