فهرست منبع

(#13289) Change test scaffolding to use a module & manifest dir fixture path

This removes the need for depending on a global site.pp, and depending on the
checked out apt module to be called 'apt' as well.

It pulls in stdlib via sub-modules as I don't have a better way to deal with
dependencies yet. It has pinned the revision for stdlib to 2.2.1 which is the
minimum required version for apt to work.
Ken Barber 12 سال پیش
والد
کامیت
0ea4ffa
5فایلهای تغییر یافته به همراه10 افزوده شده و 2 حذف شده
  1. 3 0
      .gitmodules
  2. 0 0
      spec/fixtures/manifests/site.pp
  3. 1 0
      spec/fixtures/modules/apt
  4. 1 0
      spec/fixtures/modules/stdlib
  5. 5 2
      spec/spec_helper.rb

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "spec/fixtures/modules/stdlib"]
+	path = spec/fixtures/modules/stdlib
+	url = https://github.com/puppetlabs/puppetlabs-stdlib.git

+ 0 - 0
spec/fixtures/manifests/site.pp


+ 1 - 0
spec/fixtures/modules/apt

@@ -0,0 +1 @@
+../../../

+ 1 - 0
spec/fixtures/modules/stdlib

@@ -0,0 +1 @@
+Subproject commit a70b09d5de035de5254ebe6ad6e1519a6d7cf588

+ 5 - 2
spec/spec_helper.rb

@@ -1,11 +1,14 @@
-require 'puppet'
 require 'rubygems'
+require 'puppet'
 require 'rspec-puppet'
 
 def param_value(subject, type, title, param)
   subject.resource(type, title).send(:parameters)[param.to_sym]
 end
 
+fixture_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures'))
+
 RSpec.configure do |c|
-  c.module_path = File.join(File.dirname(__FILE__), '../../')
+  c.module_path = File.join(fixture_path, 'modules')
+  c.manifest_dir = File.join(fixture_path, 'manifests')
 end