Fix rspec 3.x syntax

- Convert 'should' keyword to 'is_expected.to',
- The old ':should' syntax in rspec 3.x is deprecated in favor of ':expect'
  syntax,
- Expectations on attribute of subject with 'its'.

Change-Id: I32047319994759850aed6f35ad6cbb2951494b64
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
Gael Chamoulaud
2015-09-10 12:33:02 +02:00
parent f247f3cd5e
commit 8738c8f414
2 changed files with 9 additions and 6 deletions

View File

@@ -494,11 +494,14 @@ describe 'basic neutron_config resource' do
$neutron_files.each do |neutron_conf_file|
describe file(neutron_conf_file) do
it { should exist }
it { should contain('thisshouldexist=foo') }
it { should contain('thisshouldexist2=<SERVICE DEFAULT>') }
it { is_expected.to exist }
it { is_expected.to contain('thisshouldexist=foo') }
it { is_expected.to contain('thisshouldexist2=<SERVICE DEFAULT>') }
its(:content) { should_not match /thisshouldnotexist/ }
describe '#content' do
subject { super().content }
it { is_expected.to_not match /thisshouldnotexist/ }
end
end
end

View File

@@ -76,14 +76,14 @@ describe 'neutron::plugins::ml2::cisco::nexus' do
is_expected.to contain_neutron_plugin_ml2('ml2_cisco/host_key_checks').with_value(params[:host_key_checks])
end
it { should contain_file('nexus_config').with({
it { is_expected.to contain_file('nexus_config').with({
:path => platform_params[:cisco_ml2_config_file]}) }
it {
# Stored as an array of arrays with the first element consisting of the name and
# the second element consisting of the config hash
params[:nexus_config].each do |switch_config|
should contain_neutron__plugins__ml2__cisco__nexus_creds(switch_config.first)
is_expected.to contain_neutron__plugins__ml2__cisco__nexus_creds(switch_config.first)
end
}