aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-12-30 13:39:04 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-12-30 13:39:04 -0200
commit8a074424708a2ca7c7625e138fe29621ae3315a8 (patch)
tree0a1a47e55d7d49114cf246b9efea1e0907ee1cbd /spec
parenta1bde593bf95ea1048a35ad6c42cbad8c7a51971 (diff)
parent6fcf75d46a5c7fcd00fd4470270552b543cf4452 (diff)
downloadpuppet-common-8a074424708a2ca7c7625e138fe29621ae3315a8.tar.gz
puppet-common-8a074424708a2ca7c7625e138fe29621ae3315a8.tar.bz2
Merge branch 'master' of https://gitlab.com/shared-puppet-modules-group/commonHEADmaster
Diffstat (limited to 'spec')
-rw-r--r--spec/classes/module_dir_spec.rb17
-rw-r--r--spec/spec_helper.rb22
2 files changed, 26 insertions, 13 deletions
diff --git a/spec/classes/module_dir_spec.rb b/spec/classes/module_dir_spec.rb
new file mode 100644
index 0000000..b33afc2
--- /dev/null
+++ b/spec/classes/module_dir_spec.rb
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+describe 'common::moduledir', :type => :class do
+ let :pre_condition do
+ 'class { "common::moduledir": }'
+ end
+ let(:facts) { {
+ :lsbdistid => 'Debian',
+ :osfamily => 'Debian',
+ :operatingsystem => 'Debian',
+ :debian_release => 'jessie',
+ :debian_codename => 'jessie',
+ :lsbdistcodename => 'jessie',
+ :virtual => 'physical',
+ :puppetversion => Puppet.version, } }
+ it { is_expected.to compile.with_all_deps }
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 6ba62e1..3cca63a 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,16 +1,12 @@
-require 'pathname'
-dir = Pathname.new(__FILE__).parent
-$LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib')
-require 'puppet'
-gem 'rspec', '>= 1.2.9'
-require 'spec/autorun'
+# https://puppetlabs.com/blog/testing-modules-in-the-puppet-forge
+require 'puppetlabs_spec_helper/module_spec_helper'
-Dir[File.join(File.dirname(__FILE__), 'support', '*.rb')].each do |support_file|
- require support_file
-end
+fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
+
+RSpec.configure do |c|
+
+ c.manifest_dir = File.join(fixture_path, 'manifests')
+ c.module_path = File.join(fixture_path, 'modules')
-# We need this because the RAL uses 'should' as a method. This
-# allows us the same behaviour but with a different method name.
-class Object
- alias :must :should
+ c.color = true
end