spec: updates for rspec-puppet 2.x and rspec 3.x

This patch aim to update our specs test in order to work with the new
rspec-puppet release 2.0.0, in the mean time, we update rspec syntax
in order to be prepared for rspec 3.x move.

In details:

  * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x)
  * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0
  * Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper)

Change-Id: I512ffe4ac12763ec5a4bea935001088bad231cc1
This commit is contained in:
Sebastien Badia 2015-02-16 16:07:31 +01:00 committed by David Gurtner
parent 63cbbda8f2
commit cf6478490e
14 changed files with 121 additions and 122 deletions

View File

@ -2,11 +2,9 @@ source 'https://rubygems.org'
group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-puppet', '~> 1.0.1', :require => false
gem 'rspec-puppet', '~> 2.0.0', :require => false
gem 'beaker-rspec', '~> 2.2.4', :require => false
gem 'puppet-lint-param-docs'
gem 'rake', '10.1.1'
gem 'rspec', '< 2.99'
gem 'json'
gem 'webmock'
gem 'minitest', :require => false

View File

@ -3,10 +3,10 @@ source 'https://rubygems.org'
group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-puppet', '~> 2.0.0', :require => false
gem 'puppet-lint-param-docs'
gem 'rspec-system', :git => 'https://github.com/aldavud/rspec-system.git', :branch => 'master'
gem 'rspec-system-puppet', :git => 'https://github.com/aldavud/rspec-system-puppet.git', :branch => 'master'
gem 'rspec', '< 2.99'
end
if puppetversion = ENV['PUPPET_GEM_VERSION']

View File

@ -1,5 +1,6 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
begin
require 'rspec-system/rake_task'
rescue LoadError => e
@ -9,4 +10,4 @@ end
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_class_parameter_defaults')
PuppetLint.configuration.send('disable_class_parameter_defaults')

View File

@ -34,8 +34,8 @@ describe 'ceph::conf' do
end
it {
should contain_ceph_config('A').with('value' => "AA VALUE")
should contain_ceph_config('B').with('value' => "DEFAULT")
is_expected.to contain_ceph_config('A').with('value' => "AA VALUE")
is_expected.to contain_ceph_config('B').with('value' => "DEFAULT")
}
end

View File

@ -26,35 +26,35 @@ describe 'ceph' do
}
end
it { should contain_package('ceph').with(
it { is_expected.to contain_package('ceph').with(
'name' => 'ceph',
'ensure' => 'present') }
it { should contain_ceph_config('global/fsid').with_value('d5252e7d-75bc-4083-85ed-fe51fa83f62b') }
it { should_not contain_ceph_config('global/keyring').with_value('/etc/ceph/keyring') }
it { should_not contain_ceph_config('global/osd_pool_default_pg_num').with_value('128') }
it { should_not contain_ceph_config('global/osd_pool_default_pgp_num').with_value('128') }
it { should_not contain_ceph_config('global/osd_pool_default_size').with_value('3') }
it { should_not contain_ceph_config('global/osd_pool_default_min_size').with_value('2') }
it { should_not contain_ceph_config('global/osd_pool_default_crush_rule').with_value('0') }
it { should_not contain_ceph_config('global/mon_osd_full_ratio').with_value('90') }
it { should_not contain_ceph_config('global/mon_osd_nearfull_ratio').with_value('85') }
it { should_not contain_ceph_config('global/mon_initial_members').with_value('mon.01') }
it { should_not contain_ceph_config('global/mon_host').with_value('mon01.ceph, mon02.ceph') }
it { should_not contain_ceph_config('global/require_signatures').with_value('false') }
it { should_not contain_ceph_config('global/cluster_require_signatures').with_value('false') }
it { should_not contain_ceph_config('global/service_require_signatures').with_value('false') }
it { should_not contain_ceph_config('global/sign_messages').with_value('true') }
it { should_not contain_ceph_config('global/cluster_network').with_value('10.0.0.0/24') }
it { should_not contain_ceph_config('global/public_network').with_value('192.168.0.0/24') }
it { should contain_ceph_config('global/auth_cluster_required').with_value('cephx') }
it { should contain_ceph_config('global/auth_service_required').with_value('cephx') }
it { should contain_ceph_config('global/auth_client_required').with_value('cephx') }
it { should contain_ceph_config('global/auth_supported').with_value('cephx') }
it { should_not contain_ceph_config('global/auth_cluster_required').with_value('none') }
it { should_not contain_ceph_config('global/auth_service_required').with_value('none') }
it { should_not contain_ceph_config('global/auth_client_required').with_value('none') }
it { should_not contain_ceph_config('global/auth_supported').with_value('none') }
it { is_expected.to contain_ceph_config('global/fsid').with_value('d5252e7d-75bc-4083-85ed-fe51fa83f62b') }
it { is_expected.to_not contain_ceph_config('global/keyring').with_value('/etc/ceph/keyring') }
it { is_expected.to_not contain_ceph_config('global/osd_pool_default_pg_num').with_value('128') }
it { is_expected.to_not contain_ceph_config('global/osd_pool_default_pgp_num').with_value('128') }
it { is_expected.to_not contain_ceph_config('global/osd_pool_default_size').with_value('3') }
it { is_expected.to_not contain_ceph_config('global/osd_pool_default_min_size').with_value('2') }
it { is_expected.to_not contain_ceph_config('global/osd_pool_default_crush_rule').with_value('0') }
it { is_expected.to_not contain_ceph_config('global/mon_osd_full_ratio').with_value('90') }
it { is_expected.to_not contain_ceph_config('global/mon_osd_nearfull_ratio').with_value('85') }
it { is_expected.to_not contain_ceph_config('global/mon_initial_members').with_value('mon.01') }
it { is_expected.to_not contain_ceph_config('global/mon_host').with_value('mon01.ceph, mon02.ceph') }
it { is_expected.to_not contain_ceph_config('global/require_signatures').with_value('false') }
it { is_expected.to_not contain_ceph_config('global/cluster_require_signatures').with_value('false') }
it { is_expected.to_not contain_ceph_config('global/service_require_signatures').with_value('false') }
it { is_expected.to_not contain_ceph_config('global/sign_messages').with_value('true') }
it { is_expected.to_not contain_ceph_config('global/cluster_network').with_value('10.0.0.0/24') }
it { is_expected.to_not contain_ceph_config('global/public_network').with_value('192.168.0.0/24') }
it { is_expected.to contain_ceph_config('global/auth_cluster_required').with_value('cephx') }
it { is_expected.to contain_ceph_config('global/auth_service_required').with_value('cephx') }
it { is_expected.to contain_ceph_config('global/auth_client_required').with_value('cephx') }
it { is_expected.to contain_ceph_config('global/auth_supported').with_value('cephx') }
it { is_expected.to_not contain_ceph_config('global/auth_cluster_required').with_value('none') }
it { is_expected.to_not contain_ceph_config('global/auth_service_required').with_value('none') }
it { is_expected.to_not contain_ceph_config('global/auth_client_required').with_value('none') }
it { is_expected.to_not contain_ceph_config('global/auth_supported').with_value('none') }
end
describe "with custom params and specified fsid" do
@ -81,35 +81,35 @@ describe 'ceph' do
}
end
it { should contain_package('ceph').with(
it { is_expected.to contain_package('ceph').with(
'name' => 'ceph',
'ensure' => 'present') }
it { should contain_ceph_config('global/fsid').with_value('d5252e7d-75bc-4083-85ed-fe51fa83f62b') }
it { should contain_ceph_config('global/keyring').with_value('/usr/local/ceph/etc/keyring') }
it { should contain_ceph_config('global/osd_pool_default_pg_num').with_value('256') }
it { should contain_ceph_config('global/osd_pool_default_pgp_num').with_value('256') }
it { should contain_ceph_config('global/osd_pool_default_size').with_value('2') }
it { should contain_ceph_config('global/osd_pool_default_min_size').with_value('1') }
it { should contain_ceph_config('global/osd_pool_default_crush_rule').with_value('10') }
it { should contain_ceph_config('global/mon_osd_full_ratio').with_value('95') }
it { should contain_ceph_config('global/mon_osd_nearfull_ratio').with_value('90') }
it { should contain_ceph_config('global/mon_initial_members').with_value('mon.01') }
it { should contain_ceph_config('global/mon_host').with_value('mon01.ceph, mon02.ceph') }
it { should contain_ceph_config('global/require_signatures').with_value('true') }
it { should contain_ceph_config('global/cluster_require_signatures').with_value('true') }
it { should contain_ceph_config('global/service_require_signatures').with_value('true') }
it { should contain_ceph_config('global/sign_messages').with_value('false') }
it { should contain_ceph_config('global/cluster_network').with_value('10.0.0.0/24') }
it { should contain_ceph_config('global/public_network').with_value('192.168.0.0/24') }
it { should_not contain_ceph_config('global/auth_cluster_required').with_value('cephx') }
it { should_not contain_ceph_config('global/auth_service_required').with_value('cephx') }
it { should_not contain_ceph_config('global/auth_client_required').with_value('cephx') }
it { should_not contain_ceph_config('global/auth_supported').with_value('cephx') }
it { should contain_ceph_config('global/auth_cluster_required').with_value('none') }
it { should contain_ceph_config('global/auth_service_required').with_value('none') }
it { should contain_ceph_config('global/auth_client_required').with_value('none') }
it { should contain_ceph_config('global/auth_supported').with_value('none') }
it { is_expected.to contain_ceph_config('global/fsid').with_value('d5252e7d-75bc-4083-85ed-fe51fa83f62b') }
it { is_expected.to contain_ceph_config('global/keyring').with_value('/usr/local/ceph/etc/keyring') }
it { is_expected.to contain_ceph_config('global/osd_pool_default_pg_num').with_value('256') }
it { is_expected.to contain_ceph_config('global/osd_pool_default_pgp_num').with_value('256') }
it { is_expected.to contain_ceph_config('global/osd_pool_default_size').with_value('2') }
it { is_expected.to contain_ceph_config('global/osd_pool_default_min_size').with_value('1') }
it { is_expected.to contain_ceph_config('global/osd_pool_default_crush_rule').with_value('10') }
it { is_expected.to contain_ceph_config('global/mon_osd_full_ratio').with_value('95') }
it { is_expected.to contain_ceph_config('global/mon_osd_nearfull_ratio').with_value('90') }
it { is_expected.to contain_ceph_config('global/mon_initial_members').with_value('mon.01') }
it { is_expected.to contain_ceph_config('global/mon_host').with_value('mon01.ceph, mon02.ceph') }
it { is_expected.to contain_ceph_config('global/require_signatures').with_value('true') }
it { is_expected.to contain_ceph_config('global/cluster_require_signatures').with_value('true') }
it { is_expected.to contain_ceph_config('global/service_require_signatures').with_value('true') }
it { is_expected.to contain_ceph_config('global/sign_messages').with_value('false') }
it { is_expected.to contain_ceph_config('global/cluster_network').with_value('10.0.0.0/24') }
it { is_expected.to contain_ceph_config('global/public_network').with_value('192.168.0.0/24') }
it { is_expected.to_not contain_ceph_config('global/auth_cluster_required').with_value('cephx') }
it { is_expected.to_not contain_ceph_config('global/auth_service_required').with_value('cephx') }
it { is_expected.to_not contain_ceph_config('global/auth_client_required').with_value('cephx') }
it { is_expected.to_not contain_ceph_config('global/auth_supported').with_value('cephx') }
it { is_expected.to contain_ceph_config('global/auth_cluster_required').with_value('none') }
it { is_expected.to contain_ceph_config('global/auth_service_required').with_value('none') }
it { is_expected.to contain_ceph_config('global/auth_client_required').with_value('none') }
it { is_expected.to contain_ceph_config('global/auth_supported').with_value('none') }
end
end

View File

@ -21,8 +21,8 @@ describe 'ceph::mds' do
shared_examples_for 'ceph mds' do
describe "activated with default params" do
it { should contain_ceph_config('mds/mds_data').with_value('/var/lib/ceph/mds/$cluster-$id') }
it { should contain_ceph_config('mds/keyring').with_value('/var/lib/ceph/mds/$cluster-$id/keyring') }
it { is_expected.to contain_ceph_config('mds/mds_data').with_value('/var/lib/ceph/mds/$cluster-$id') }
it { is_expected.to contain_ceph_config('mds/keyring').with_value('/var/lib/ceph/mds/$cluster-$id/keyring') }
end
@ -34,8 +34,8 @@ describe 'ceph::mds' do
}
end
it { should contain_ceph_config('mds/mds_data').with_value('/usr/local/ceph/var/lib/mds/_cluster-_id') }
it { should contain_ceph_config('mds/keyring').with_value('/usr/local/ceph/var/lib/mds/_cluster-_id/keyring') }
it { is_expected.to contain_ceph_config('mds/mds_data').with_value('/usr/local/ceph/var/lib/mds/_cluster-_id') }
it { is_expected.to contain_ceph_config('mds/keyring').with_value('/usr/local/ceph/var/lib/mds/_cluster-_id/keyring') }
end
@ -46,10 +46,10 @@ describe 'ceph::mds' do
}
end
it { should_not contain_ceph_config('mds/mds_data').with_value('/var/lib/ceph/mds/_cluster-_id') }
it { should_not contain_ceph_config('mds/keyring').with_value('/var/lib/ceph/mds/_cluster-_id/keyring') }
it { should contain_ceph_config('mds/mds_data').with_ensure('absent') }
it { should contain_ceph_config('mds/keyring').with_ensure('absent') }
it { is_expected.to_not contain_ceph_config('mds/mds_data').with_value('/var/lib/ceph/mds/_cluster-_id') }
it { is_expected.to_not contain_ceph_config('mds/keyring').with_value('/var/lib/ceph/mds/_cluster-_id/keyring') }
it { is_expected.to contain_ceph_config('mds/mds_data').with_ensure('absent') }
it { is_expected.to contain_ceph_config('mds/keyring').with_ensure('absent') }
end
end

View File

@ -41,8 +41,8 @@ describe 'ceph::mons' do
end
it {
should contain_service('ceph-mon-A').with('ensure' => "running")
should contain_service('ceph-mon-B').with('ensure' => "running")
is_expected.to contain_service('ceph-mon-A').with('ensure' => "running")
is_expected.to contain_service('ceph-mon-B').with('ensure' => "running")
}
end

View File

@ -36,12 +36,12 @@ describe 'ceph::osds' do
end
it {
should contain_ceph__osd('/dev/sdb').with(
is_expected.to contain_ceph__osd('/dev/sdb').with(
:ensure => 'present',
:journal => '/tmp/journal',
:cluster => 'CLUSTER'
)
should contain_ceph__osd('/srv/data').with(
is_expected.to contain_ceph__osd('/srv/data').with(
:ensure => 'present',
:cluster => 'CLUSTER')
}

View File

@ -21,18 +21,18 @@ describe 'ceph::profile::base' do
shared_examples_for 'ceph profile base' do
describe "with default params" do
it { should contain_class('ceph::profile::params') }
it { should contain_class('ceph::repo') }
it { should contain_class('ceph') }
it { is_expected.to contain_class('ceph::profile::params') }
it { is_expected.to contain_class('ceph::repo') }
it { is_expected.to contain_class('ceph') }
end
describe "with custom param manage_repo false" do
let :pre_condition do
"class { 'ceph::profile::params': manage_repo => false }"
end
it { should contain_class('ceph::profile::params') }
it { should_not contain_class('ceph::repo') }
it { should contain_class('ceph') }
it { is_expected.to contain_class('ceph::profile::params') }
it { is_expected.to_not contain_class('ceph::repo') }
it { is_expected.to contain_class('ceph') }
end
end

View File

@ -20,7 +20,7 @@ require 'spec_helper'
describe 'ceph::profile::client' do
shared_examples_for 'ceph profile client' do
it { should contain_ceph__key('client.admin').with(
it { is_expected.to contain_ceph__key('client.admin').with(
:secret => 'AQBMGHJTkC8HKhAAJ7NH255wYypgm1oVuV41MA==',
:keyring_path => '/etc/ceph/ceph.client.admin.keyring',
:mode => '0644')

View File

@ -20,11 +20,11 @@ require 'spec_helper'
describe 'ceph::profile::mon' do
shared_examples_for 'ceph profile mon' do
it { should contain_ceph__mon('first').with(
it { is_expected.to contain_ceph__mon('first').with(
:authentication_type => 'cephx',
:key => 'AQATGHJTUCBqIBAA7M2yafV1xctn1pgr3GcKPg==')
}
it { should contain_ceph__key('client.admin').with(
it { is_expected.to contain_ceph__key('client.admin').with(
:secret => 'AQBMGHJTkC8HKhAAJ7NH255wYypgm1oVuV41MA==',
:cap_mon => 'allow *',
:cap_osd => 'allow *',
@ -34,7 +34,7 @@ describe 'ceph::profile::mon' do
:inject_as_id => 'mon.',
:inject_keyring => '/var/lib/ceph/mon/ceph-first/keyring')
}
it { should contain_ceph__key('client.bootstrap-osd').with(
it { is_expected.to contain_ceph__key('client.bootstrap-osd').with(
:secret => 'AQARG3JTsDDEHhAAVinHPiqvJkUi5Mww/URupw==',
:keyring_path => '/var/lib/ceph/bootstrap-osd/ceph.keyring',
:cap_mon => 'allow profile bootstrap-osd',
@ -42,7 +42,7 @@ describe 'ceph::profile::mon' do
:inject_as_id => 'mon.',
:inject_keyring => '/var/lib/ceph/mon/ceph-first/keyring')
}
it { should contain_ceph__key('client.bootstrap-mds').with(
it { is_expected.to contain_ceph__key('client.bootstrap-mds').with(
:secret => 'AQCztJdSyNb0NBAASA2yPZPuwXeIQnDJ9O8gVw==',
:keyring_path => '/var/lib/ceph/bootstrap-mds/ceph.keyring',
:cap_mon => 'allow profile bootstrap-mds',

View File

@ -26,12 +26,12 @@ describe 'ceph::profile::osd' do
facts.merge!( :hostname => 'osd')
end
it { should contain_ceph__key('client.bootstrap-osd').with(
it { is_expected.to contain_ceph__key('client.bootstrap-osd').with(
:keyring_path => '/var/lib/ceph/bootstrap-osd/ceph.keyring',
:secret => 'AQARG3JTsDDEHhAAVinHPiqvJkUi5Mww/URupw==')
}
it { should contain_ceph__osd('/dev/sdc').with(:journal => '/dev/sdb1') }
it { should contain_ceph__osd('/dev/sdd').with(:journal => '/dev/sdb2') }
it { is_expected.to contain_ceph__osd('/dev/sdc').with(:journal => '/dev/sdb1') }
it { is_expected.to contain_ceph__osd('/dev/sdd').with(:journal => '/dev/sdb2') }
end
context 'with the host specific first.yaml' do
@ -40,11 +40,11 @@ describe 'ceph::profile::osd' do
facts.merge!( :hostname => 'first')
end
it { should contain_ceph__key('client.bootstrap-osd').with(
it { is_expected.to contain_ceph__key('client.bootstrap-osd').with(
:keyring_path => '/var/lib/ceph/bootstrap-osd/ceph.keyring',
:secret => 'AQARG3JTsDDEHhAAVinHPiqvJkUi5Mww/URupw==')
}
it { should contain_ceph__osd('/dev/sdb').with( :journal => '/tmp/journal') }
it { is_expected.to contain_ceph__osd('/dev/sdb').with( :journal => '/tmp/journal') }
end
end

View File

@ -32,12 +32,12 @@ describe 'ceph::repo' do
describe "with default params" do
it { should contain_apt__key('ceph').with(
it { is_expected.to contain_apt__key('ceph').with(
:key => '17ED316D',
:key_source => 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc'
) }
it { should contain_apt__source('ceph').with(
it { is_expected.to contain_apt__source('ceph').with(
:location => 'http://ceph.com/debian-giant/',
:release => 'wheezy',
:require => 'Apt::Key[ceph]'
@ -52,7 +52,7 @@ describe 'ceph::repo' do
}
end
it { should contain_apt__source('ceph').with(
it { is_expected.to contain_apt__source('ceph').with(
:location => 'http://ceph.com/debian-firefly/',
:release => 'wheezy',
:require => 'Apt::Key[ceph]'
@ -73,12 +73,12 @@ describe 'ceph::repo' do
describe "with default params" do
it { should contain_apt__key('ceph').with(
it { is_expected.to contain_apt__key('ceph').with(
:key => '17ED316D',
:key_source => 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc'
) }
it { should contain_apt__source('ceph').with(
it { is_expected.to contain_apt__source('ceph').with(
:location => 'http://ceph.com/debian-giant/',
:release => 'precise',
:require => 'Apt::Key[ceph]'
@ -93,7 +93,7 @@ describe 'ceph::repo' do
}
end
it { should contain_apt__source('ceph').with(
it { is_expected.to contain_apt__source('ceph').with(
:location => 'http://ceph.com/debian-firefly/',
:release => 'precise',
:require => 'Apt::Key[ceph]'
@ -107,13 +107,13 @@ describe 'ceph::repo' do
}
end
it { should contain_apt__source('ceph').with(
it { is_expected.to contain_apt__source('ceph').with(
:location => 'http://ceph.com/debian-giant/',
:release => 'precise',
:require => 'Apt::Key[ceph]'
) }
it { should contain_apt__source('ceph-extras').with(
it { is_expected.to contain_apt__source('ceph-extras').with(
:ensure => 'present',
:location => 'http://ceph.com/packages/ceph-extras/debian/',
:release => 'precise',
@ -129,18 +129,18 @@ describe 'ceph::repo' do
}
end
it { should contain_apt__key('ceph-gitbuilder').with(
it { is_expected.to contain_apt__key('ceph-gitbuilder').with(
:key => '6EAEAE2203C3951A',
:key_server => 'keyserver.ubuntu.com'
) }
it { should contain_apt__source('ceph').with(
it { is_expected.to contain_apt__source('ceph').with(
:location => 'http://ceph.com/debian-giant/',
:release => 'precise',
:require => 'Apt::Key[ceph]'
) }
it { should contain_apt__source('ceph-fastcgi').with(
it { is_expected.to contain_apt__source('ceph-fastcgi').with(
:ensure => 'present',
:location => 'http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-precise-x86_64-basic/ref/master',
:release => 'precise',
@ -158,21 +158,21 @@ describe 'ceph::repo' do
}
end
it { should contain_apt__source('ceph').with(
it { is_expected.to contain_apt__source('ceph').with(
:ensure => 'absent',
:location => 'http://ceph.com/debian-giant/',
:release => 'precise',
:require => 'Apt::Key[ceph]'
) }
it { should contain_apt__source('ceph-extras').with(
it { is_expected.to contain_apt__source('ceph-extras').with(
:ensure => 'absent',
:location => 'http://ceph.com/packages/ceph-extras/debian/',
:release => 'precise',
:require => 'Apt::Key[ceph]'
) }
it { should contain_apt__source('ceph-fastcgi').with(
it { is_expected.to contain_apt__source('ceph-fastcgi').with(
:ensure => 'absent',
:location => 'http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-precise-x86_64-basic/ref/master',
:release => 'precise',
@ -193,7 +193,7 @@ describe 'ceph::repo' do
describe "with default params" do
it { should contain_yumrepo('ext-epel-6.8').with(
it { is_expected.to contain_yumrepo('ext-epel-6.8').with(
:enabled => '1',
:descr => 'External EPEL 6.8',
:name => 'ext-epel-6.8',
@ -204,7 +204,7 @@ describe 'ceph::repo' do
:priority => '20'
) }
it { should contain_yumrepo('ext-ceph').with(
it { is_expected.to contain_yumrepo('ext-ceph').with(
:enabled => '1',
:descr => 'External Ceph giant',
:name => 'ext-ceph-giant',
@ -215,7 +215,7 @@ describe 'ceph::repo' do
:priority => '10'
) }
it { should contain_yumrepo('ext-ceph-noarch').with(
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
:enabled => '1',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-giant-noarch',
@ -234,7 +234,7 @@ describe 'ceph::repo' do
}
end
it { should contain_yumrepo('ext-epel-6.8').with(
it { is_expected.to contain_yumrepo('ext-epel-6.8').with(
:enabled => '1',
:descr => 'External EPEL 6.8',
:name => 'ext-epel-6.8',
@ -245,7 +245,7 @@ describe 'ceph::repo' do
:priority => '20'
) }
it { should contain_yumrepo('ext-ceph').with(
it { is_expected.to contain_yumrepo('ext-ceph').with(
:enabled => '1',
:descr => 'External Ceph firefly',
:name => 'ext-ceph-firefly',
@ -256,7 +256,7 @@ describe 'ceph::repo' do
:priority => '10'
) }
it { should contain_yumrepo('ext-ceph-noarch').with(
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
:enabled => '1',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-firefly-noarch',
@ -277,7 +277,7 @@ describe 'ceph::repo' do
}
end
it { should contain_yumrepo('ext-epel-6.8').with(
it { is_expected.to contain_yumrepo('ext-epel-6.8').with(
:enabled => '0',
:descr => 'External EPEL 6.8',
:name => 'ext-epel-6.8',
@ -288,7 +288,7 @@ describe 'ceph::repo' do
:priority => '20'
) }
it { should contain_yumrepo('ext-ceph').with(
it { is_expected.to contain_yumrepo('ext-ceph').with(
:enabled => '0',
:descr => 'External Ceph giant',
:name => 'ext-ceph-giant',
@ -299,7 +299,7 @@ describe 'ceph::repo' do
:priority => '10'
) }
it { should contain_yumrepo('ext-ceph-noarch').with(
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
:enabled => '0',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-giant-noarch',
@ -310,7 +310,7 @@ describe 'ceph::repo' do
:priority => '10'
) }
it { should contain_yumrepo('ext-ceph-extras').with(
it { is_expected.to contain_yumrepo('ext-ceph-extras').with(
:enabled => '0',
:descr => 'External Ceph Extras',
:name => 'ext-ceph-extras',
@ -321,7 +321,7 @@ describe 'ceph::repo' do
:priority => '10'
) }
it { should contain_yumrepo('ext-ceph-fastcgi').with(
it { is_expected.to contain_yumrepo('ext-ceph-fastcgi').with(
:enabled => '0',
:descr => 'FastCGI basearch packages for Ceph',
:name => 'ext-ceph-fastcgi',
@ -341,7 +341,7 @@ describe 'ceph::repo' do
}
end
it { should contain_yumrepo('ext-epel-6.8').with(
it { is_expected.to contain_yumrepo('ext-epel-6.8').with(
:enabled => '1',
:descr => 'External EPEL 6.8',
:name => 'ext-epel-6.8',
@ -352,7 +352,7 @@ describe 'ceph::repo' do
:priority => '20'
) }
it { should contain_yumrepo('ext-ceph').with(
it { is_expected.to contain_yumrepo('ext-ceph').with(
:enabled => '1',
:descr => 'External Ceph giant',
:name => 'ext-ceph-giant',
@ -363,7 +363,7 @@ describe 'ceph::repo' do
:priority => '10'
) }
it { should contain_yumrepo('ext-ceph-noarch').with(
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
:enabled => '1',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-giant-noarch',
@ -374,7 +374,7 @@ describe 'ceph::repo' do
:priority => '10'
) }
it { should contain_yumrepo('ext-ceph-extras').with(
it { is_expected.to contain_yumrepo('ext-ceph-extras').with(
:enabled => '1',
:descr => 'External Ceph Extras',
:name => 'ext-ceph-extras',
@ -394,7 +394,7 @@ describe 'ceph::repo' do
}
end
it { should contain_yumrepo('ext-epel-6.8').with(
it { is_expected.to contain_yumrepo('ext-epel-6.8').with(
:enabled => '1',
:descr => 'External EPEL 6.8',
:name => 'ext-epel-6.8',
@ -405,7 +405,7 @@ describe 'ceph::repo' do
:priority => '20'
) }
it { should contain_yumrepo('ext-ceph').with(
it { is_expected.to contain_yumrepo('ext-ceph').with(
:enabled => '1',
:descr => 'External Ceph giant',
:name => 'ext-ceph-giant',
@ -416,7 +416,7 @@ describe 'ceph::repo' do
:priority => '10'
) }
it { should contain_yumrepo('ext-ceph-noarch').with(
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
:enabled => '1',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-giant-noarch',
@ -427,7 +427,7 @@ describe 'ceph::repo' do
:priority => '10'
) }
it { should contain_yumrepo('ext-ceph-fastcgi').with(
it { is_expected.to contain_yumrepo('ext-ceph-fastcgi').with(
:enabled => '1',
:descr => 'FastCGI basearch packages for Ceph',
:name => 'ext-ceph-fastcgi',

View File

@ -50,9 +50,9 @@ describe provider_class do
resource = Puppet::Type::Ceph_config.new(params.merge(
:name => 'global/ceph_is_foo', :value => 'bar'))
provider = provider_class.new(resource)
provider.exists?.should be_false
provider.exists?.should be_falsey
provider.create
provider.exists?.should be_true
provider.exists?.should be_truthy
validate(<<-EOS
[global]