(#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.
This commit is contained in:
parent
a758247f26
commit
0ea4ffa9a2
5 changed files with 10 additions and 2 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "spec/fixtures/modules/stdlib"]
|
||||
path = spec/fixtures/modules/stdlib
|
||||
url = https://github.com/puppetlabs/puppetlabs-stdlib.git
|
0
spec/fixtures/manifests/site.pp
vendored
Normal file
0
spec/fixtures/manifests/site.pp
vendored
Normal file
1
spec/fixtures/modules/apt
vendored
Symbolic link
1
spec/fixtures/modules/apt
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../../
|
1
spec/fixtures/modules/stdlib
vendored
Submodule
1
spec/fixtures/modules/stdlib
vendored
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit a70b09d5de035de5254ebe6ad6e1519a6d7cf588
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue