Implement rspec function it_raises

On some puppet modules, a it_raises helper is provided. This commit
implements it for puppet-cinder.

Change-Id: I8135480f821a17fd88e5cb088efc2f6fe78b1c48
This commit is contained in:
Yanis Guenane 2014-05-15 14:45:37 -04:00
parent 6e05262048
commit 183d45ec4f
2 changed files with 7 additions and 0 deletions

5
spec/shared_examples.rb Normal file
View File

@ -0,0 +1,5 @@
shared_examples_for "a Puppet::Error" do |description|
it "with message matching #{description.inspect}" do
expect { should have_class_count(1) }.to raise_error(Puppet::Error, description)
end
end

View File

@ -1,5 +1,7 @@
require 'puppetlabs_spec_helper/module_spec_helper'
require 'shared_examples'
RSpec.configure do |c|
c.alias_it_should_behave_like_to :it_configures, 'configures'
c.alias_it_should_behave_like_to :it_raises, 'raises'
end