aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMickaël Canévet <mickael.canevet@camptocamp.com>2014-10-27 12:16:17 +0100
committerMickaël Canévet <mickael.canevet@camptocamp.com>2014-10-27 12:16:17 +0100
commit73965f9f088a04b0d37d6b9063bb24e9c64e074a (patch)
treeccef5a48c80087ee7b4acac8c600cc75f14e8e26 /spec
parentd79e5b3be8ee6d0312bdbe9846aa18edcfcdad41 (diff)
downloadpuppet-dhcp-73965f9f088a04b0d37d6b9063bb24e9c64e074a.tar.gz
puppet-dhcp-73965f9f088a04b0d37d6b9063bb24e9c64e074a.tar.bz2
Use modulesync to manage meta files
Diffstat (limited to 'spec')
-rw-r--r--spec/spec_helper.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 2471da9..adbb191 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -23,3 +23,24 @@ RSpec.configure do |c|
PuppetlabsSpec::Files.cleanup
end
end
+
+require 'pathname'
+dir = Pathname.new(__FILE__).parent
+Puppet[:modulepath] = File.join(dir, 'fixtures', 'modules')
+
+# There's no real need to make this version dependent, but it helps find
+# regressions in Puppet
+#
+# 1. Workaround for issue #16277 where default settings aren't initialised from
+# a spec and so the libdir is never initialised (3.0.x)
+# 2. Workaround for 2.7.20 that now only loads types for the current node
+# environment (#13858) so Puppet[:modulepath] seems to get ignored
+# 3. Workaround for 3.5 where context hasn't been configured yet,
+# ticket https://tickets.puppetlabs.com/browse/MODULES-823
+#
+ver = Gem::Version.new(Puppet.version.split('-').first)
+if Gem::Requirement.new("~> 2.7.20") =~ ver || Gem::Requirement.new("~> 3.0.0") =~ ver || Gem::Requirement.new("~> 3.5") =~ ver
+ puts "augeasproviders: setting Puppet[:libdir] to work around broken type autoloading"
+ # libdir is only a single dir, so it can only workaround loading of one external module
+ Puppet[:libdir] = "#{Puppet[:modulepath]}/augeasproviders_core/lib"
+end