summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/shared_examples.rb5
-rw-r--r--spec/spec_helper.rb16
2 files changed, 21 insertions, 0 deletions
diff --git a/spec/shared_examples.rb b/spec/shared_examples.rb
new file mode 100644
index 0000000..fec0eac
--- /dev/null
+++ b/spec/shared_examples.rb
@@ -0,0 +1,5 @@
+shared_examples_for "a Puppet::Error" do |description|
+ it "with message matching #{description.inspect}" do
+ expect { is_expected.to have_class_count(1) }.to raise_error(Puppet::Error, description)
+ end
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644
index 0000000..0171d5d
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -0,0 +1,16 @@
+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'
+
+ c.default_facts = {
+ :kernel => 'Linux',
+ :concat_basedir => '/var/lib/puppet/concat',
+ :memorysize => '1000 MB',
+ :processorcount => '1',
+ :puppetversion => '3.7.3',
+ :uniqueid => '123'
+ }
+end