Skip to content

Commit d68277a

Browse files
committed
finished unittest
1 parent d2275cc commit d68277a

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/bosh-director/spec/unit/deployment_plan/steps/create_vm_step_spec.rb

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -694,27 +694,28 @@ module Steps
694694
end
695695

696696
context 'password is specified in cloud_properties' do
697-
let(:variables_interpolator) { instance_double(Bosh::Director::ConfigServer::VariablesInterpolator) }
698-
let(:cloud_properties) do
699-
{ env: {
700-
bosh: {
701-
password: 'foo123'
697+
let(:custom_cloud_properties) do
698+
{
699+
'ram' => '4gb',
700+
'disk' => '20gb',
701+
'env' => {
702+
'bosh' => {
703+
'password' => 'foo123'
702704
}
703705
}
704706
}
705707
end
706708

707709
before do
708-
allow(Bosh::Director::ConfigServer::VariablesInterpolator).to receive(:new).and_return(variables_interpolator)
709-
allow(variables_interpolator).to receive(:interpolate_with_versioning).and_return(cloud_properties)
710+
allow(instance).to receive(:cloud_properties).and_return(custom_cloud_properties)
710711
end
711712

712-
it 'should generate a random VM password' do
713-
expect(cloud_wrapper).to receive(:create_vm) do |_, _, _, _, _, env|
714-
expect(env['bosh']['password']).to eq('foo123')
715-
end.and_return(create_vm_response)
713+
it 'calls perform with custom cloud_properties' do
714+
expect(cloud_wrapper).to receive(:create_vm) do |_, _, _, _, _, env|
715+
expect(env['bosh']['password']).to eq('foo123')
716+
end.and_return(create_vm_response)
716717

717-
subject.perform(report)
718+
subject.perform(report)
718719
end
719720
end
720721
end

0 commit comments

Comments
 (0)