From ad142c3ee3a44505a50524ea8ec2e77cebf2602e Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Fri, 2 Nov 2012 10:46:09 -0700 Subject: [PATCH] fix test failures The tests were failing b/c they assume a hash would be processed in order. The tests have been updated to check the expected keys individually. --- spec/classes/openstack_controller_spec.rb | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/spec/classes/openstack_controller_spec.rb b/spec/classes/openstack_controller_spec.rb index fc7d047..47ed501 100644 --- a/spec/classes/openstack_controller_spec.rb +++ b/spec/classes/openstack_controller_spec.rb @@ -62,11 +62,12 @@ describe 'openstack::controller' do ) end - it { should contain_class('mysql::server').with( - :config_hash => {'bind_address' => '0.0.0.0', 'root_password' => 'sql_pass' }, - :enabled => true - ) - } + it 'should configure mysql server' do + param_value(subject, 'class', 'mysql::server', 'enabled').should be_true + config_hash = param_value(subject, 'class', 'mysql::server', 'config_hash') + config_hash['bind_address'].should == '0.0.0.0' + config_hash['root_password'].should == 'sql_pass' + end it 'should contain openstack db config' do should contain_class('keystone::db::mysql').with( @@ -129,11 +130,12 @@ describe 'openstack::controller' do ) end - it { should contain_class('mysql::server').with( - :config_hash => {'bind_address' => '0.0.0.0', 'root_password' => 'sql_pass' }, - :enabled => false - ) - } + it 'should configure mysql server' do + param_value(subject, 'class', 'mysql::server', 'enabled').should be_false + config_hash = param_value(subject, 'class', 'mysql::server', 'config_hash') + config_hash['bind_address'].should == '0.0.0.0' + config_hash['root_password'].should == 'sql_pass' + end ['keystone', 'nova', 'glance', 'cinder', 'quantum'].each do |x| it { should_not contain_class("#{x}::db::mysql") }