summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-11-02 22:47:30 +0100
committerLouis-Philippe VĂ©ronneau <pollito@riseup.net>2017-01-21 14:54:03 -0500
commit263c8e96cecb2babd065b66d4c67fb648b0dc079 (patch)
tree77154c1cc68e275fcf069e5616824639cf033b96
parent4b01558ddbca56ac054ae268c21fb65c870020c8 (diff)
Improve tests setup
- Add .fixtures.yaml to checkout common module - Use puppetlabs-spec-helper in spec_helper.rb
-rw-r--r--.fixtures.yml6
-rw-r--r--Gemfile4
-rw-r--r--spec/spec_helper.rb12
3 files changed, 14 insertions, 8 deletions
diff --git a/.fixtures.yml b/.fixtures.yml
new file mode 100644
index 0000000..99efd66
--- /dev/null
+++ b/.fixtures.yml
@@ -0,0 +1,6 @@
+fixtures:
+ repositories:
+ "common":
+ "repo": "https://gitlab.com/shared-puppet-modules-group/common.git"
+ symlinks:
+ "apt": "#{source_dir}"
diff --git a/Gemfile b/Gemfile
index 7ef1ec3..44630f4 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,8 +2,8 @@ source "https://rubygems.org"
group :development, :unit_tests do
gem "rake"
- gem "rspec", '< 3.2.0'
- gem "rspec-puppet"
+ gem "rspec-puppet", "~> 2.1", :require => false
+ gem "rspec-core", "3.1.7", :require => false
gem "puppetlabs_spec_helper"
gem "metadata-json-lint"
gem "rspec-puppet-facts"
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 21d1a98..3cca63a 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,12 +1,12 @@
# https://puppetlabs.com/blog/testing-modules-in-the-puppet-forge
-require 'rspec-puppet'
-require 'mocha/api'
+require 'puppetlabs_spec_helper/module_spec_helper'
-RSpec.configure do |c|
+fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
- c.module_path = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
- c.color = true
+RSpec.configure do |c|
- #Puppet.features.stubs(:root? => true)
+ c.manifest_dir = File.join(fixture_path, 'manifests')
+ c.module_path = File.join(fixture_path, 'modules')
+ c.color = true
end