From 6c480393fe32e9f5ad90bdfe39509f2a1fc77fa7 Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Wed, 22 Jan 2014 13:23:56 +0000 Subject: [PATCH] Remove ambiguity in stubbed methods in spec_helper - Adjust the stubs in spec/spec_helper.rb to specify the appropriate number of expected variables - Add parenthensis around return values Change-Id: Id92fbfad0433fcdcbe0ab6909a0b717d614ac62c Partial-Bug: #1271535 --- spec/spec_helper.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7d6cb5a..83b33e9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -26,17 +26,22 @@ require_relative 'support/matcher' def block_storage_stubs # rubocop:disable MethodLength ::Chef::Recipe.any_instance.stub(:rabbit_servers) - .and_return '1.1.1.1:5672,2.2.2.2:5672' - ::Chef::Recipe.any_instance.stub(:get_password).and_return '' + .and_return('1.1.1.1:5672,2.2.2.2:5672') + ::Chef::Recipe.any_instance.stub(:get_password) + .with('service', anything) + .and_return('') + ::Chef::Recipe.any_instance.stub(:get_password) + .with('db', anything) + .and_return('') ::Chef::Recipe.any_instance.stub(:secret) .with('secrets', 'openstack_identity_bootstrap_token') - .and_return 'bootstrap-token' + .and_return('bootstrap-token') ::Chef::Recipe.any_instance.stub(:get_password) .with('user', 'guest') - .and_return 'rabbit-pass' + .and_return('rabbit-pass') ::Chef::Recipe.any_instance.stub(:get_password) .with('service', 'openstack-block-storage') - .and_return 'cinder-pass' + .and_return('cinder-pass') ::Chef::Application.stub(:fatal!) end