required_params
end
- it { should contain_mysql_database(title).with(
+ it { is_expected.to contain_mysql_database(title).with(
:charset => 'utf8',
:collate => 'utf8_general_ci'
)}
- it { should contain_openstacklib__db__mysql__host_access("#{title}_127.0.0.1").with(
+ it { is_expected.to contain_openstacklib__db__mysql__host_access("#{title}_127.0.0.1").with(
:user => title,
:database => title,
:privileges => 'ALL'
{ :dbname => 'foobar' }.merge(required_params)
end
- it { should contain_mysql_database(params[:dbname]).with(
+ it { is_expected.to contain_mysql_database(params[:dbname]).with(
:charset => 'utf8',
:collate => 'utf8_general_ci'
)}
- it { should contain_openstacklib__db__mysql__host_access("#{params[:dbname]}_127.0.0.1").with(
+ it { is_expected.to contain_openstacklib__db__mysql__host_access("#{params[:dbname]}_127.0.0.1").with(
:user => title,
:database => params[:dbname],
:privileges => 'ALL'
{ :user => 'foobar' }.merge(required_params)
end
- it { should contain_mysql_database(title).with(
+ it { is_expected.to contain_mysql_database(title).with(
:charset => 'utf8',
:collate => 'utf8_general_ci'
)}
- it { should contain_openstacklib__db__mysql__host_access("#{title}_127.0.0.1").with(
+ it { is_expected.to contain_openstacklib__db__mysql__host_access("#{title}_127.0.0.1").with(
:user => params[:user],
:database => title,
:privileges => 'ALL',
{ :charset => 'latin1' }.merge(required_params)
end
- it { should contain_mysql_database(title).with_charset(params[:charset]) }
+ it { is_expected.to contain_mysql_database(title).with_charset(params[:charset]) }
end
context 'when omitting the required parameter password_hash' do
let :params do
required_params.delete(:password_hash)
end
- it { expect { should raise_error(Puppet::Error) } }
+ it { expect { is_expected.to raise_error(Puppet::Error) } }
end
context 'when notifying other resources' do
{ :notify => 'Exec[nova-db-sync]'}.merge(required_params)
end
- it { should contain_exec('nova-db-sync').that_subscribes_to("Openstacklib::Db::Mysql[#{title}]") }
+ it { is_expected.to contain_exec('nova-db-sync').that_subscribes_to("Openstacklib::Db::Mysql[#{title}]") }
end
context 'when required for other openstack services' do
{ :before => 'Service[keystone]'}.merge(required_params)
end
- it { should contain_service('keystone').that_requires("Openstacklib::Db::Mysql[keystone]") }
+ it { is_expected.to contain_service('keystone').that_requires("Openstacklib::Db::Mysql[keystone]") }
end
context "overriding allowed_hosts parameter with array value" do
{ :allowed_hosts => ['127.0.0.1','%'] }.merge(required_params)
end
- it {should contain_openstacklib__db__mysql__host_access("#{title}_127.0.0.1").with(
+ it {is_expected.to contain_openstacklib__db__mysql__host_access("#{title}_127.0.0.1").with(
:user => title,
:password_hash => params[:password_hash],
:database => title
)}
- it {should contain_openstacklib__db__mysql__host_access("#{title}_%").with(
+ it {is_expected.to contain_openstacklib__db__mysql__host_access("#{title}_%").with(
:user => title,
:password_hash => params[:password_hash],
:database => title
{ :allowed_hosts => '192.168.1.1' }.merge(required_params)
end
- it {should contain_openstacklib__db__mysql__host_access("#{title}_192.168.1.1").with(
+ it {is_expected.to contain_openstacklib__db__mysql__host_access("#{title}_192.168.1.1").with(
:user => title,
:password_hash => params[:password_hash],
:database => title
{ :allowed_hosts => '127.0.0.1' }.merge(required_params)
end
- it {should contain_openstacklib__db__mysql__host_access("#{title}_127.0.0.1").with(
+ it {is_expected.to contain_openstacklib__db__mysql__host_access("#{title}_127.0.0.1").with(
:user => title,
:password_hash => params[:password_hash],
:database => title