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

Partial-Bug: #1271535
Change-Id: I1aa473e406059fec66b0b2c9a307e8eeb41b0996
This commit is contained in:
Andy McCrae
2014-01-22 13:51:37 +00:00
parent 2df29de194
commit dc58cbe2a8

View File

@@ -46,7 +46,7 @@ MOCK_NODE_NETWORK_DATA =
def neutron_stubs
::Chef::Recipe.any_instance.stub(:rabbit_servers)
.and_return '1.1.1.1:5672,2.2.2.2:5672'
.and_return('1.1.1.1:5672,2.2.2.2:5672')
::Chef::Recipe.any_instance.stub(:config_by_role)
.with('rabbitmq-server', 'queue').and_return(
host: 'rabbit-host',
@@ -54,19 +54,18 @@ def neutron_stubs
)
::Chef::Recipe.any_instance.stub(:config_by_role)
.with('glance-api', 'glance').and_return []
::Chef::Recipe.any_instance.stub(:get_password).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(:secret)
.with('secrets', 'neutron_metadata_secret')
.and_return 'metadata-secret'
.and_return('metadata-secret')
::Chef::Recipe.any_instance.stub(:get_password)
.with('db', anything())
.and_return 'neutron'
.and_return('neutron')
::Chef::Recipe.any_instance.stub(:get_password)
.with('service', 'openstack-network')
.and_return 'neutron-pass'
.and_return('neutron-pass')
::Chef::Recipe.any_instance.stub(:get_password)
.with('user', 'guest')
.and_return('rabbit-password')