puppet-keystone/spec/classes/keystone_service_spec.rb
Sebastien Badia fa7d680c0d 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
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:

  * Use shared_examples "a Puppet::Error" for puppet::error tests
  * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x)
  * Fix spec tests for rspec-puppet 2.0.0
  * 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)
  * Standardize gemfile (add json, webmock)

Change-Id: I35a39d4f3919d56c9448f0a0602cfe284ebc2e9c
Card: https://trello.com/c/eHXc1Ryd/4-investigate-the-necessary-change-to-be-rspec-puppet-2-0-0-compliant
2015-03-15 18:09:53 +01:00

32 lines
758 B
Ruby

require 'spec_helper'
describe 'keystone::service' do
describe "with default parameters" do
it { is_expected.to contain_service('keystone').with(
:ensure => 'running',
:enable => true,
:hasstatus => true,
:hasrestart => true
) }
it { is_expected.to_not contain_exec('validate_keystone_connection') }
end
describe "with validation on" do
let :params do
{
:validate => 'true',
:admin_token => 'admintoken'
}
end
it { is_expected.to contain_service('keystone').with(
:ensure => 'running',
:enable => true,
:hasstatus => true,
:hasrestart => true
) }
it { is_expected.to contain_exec('validate_keystone_connection') }
end
end