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:
parent
6e05262048
commit
183d45ec4f
5
spec/shared_examples.rb
Normal file
5
spec/shared_examples.rb
Normal 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
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user