mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
RSpec mocking for TCPSocket.new
This commit is contained in:
parent
5b6985c3a7
commit
d1c8bcdbcc
1 changed files with 4 additions and 0 deletions
|
|
@ -35,10 +35,14 @@ describe 'Pool Manager' do
|
|||
|
||||
context 'host is in pool' do
|
||||
let(:vm_finder) { double('vm_finder') }
|
||||
let(:tcpsocket) { double('TCPSocket') }
|
||||
|
||||
it 'calls move_pending_vm_to_ready' do
|
||||
stub_const("TCPSocket", tcpsocket)
|
||||
|
||||
allow(pool_helper).to receive(:find_vm).and_return(vm_finder)
|
||||
allow(vm_finder).to receive(:summary).and_return(nil)
|
||||
allow(tcpsocket).to receive(:new).and_return(true)
|
||||
|
||||
expect(vm_finder).to receive(:summary).once
|
||||
expect(redis).not_to receive(:hget).with(String, 'clone')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue