X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fspec_helper.rb;h=5e721b7ff4d57a0388bb30676ba8ccc3cf5dd477;hb=9e1c4d53d9056b662849d5950a56ec3d5ebb8027;hp=e117192684d1d907d001bf542592bdea4f0e470e;hpb=5b83f92099098196e67c8173b47b970c3dbbbdd6;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e117192..5e721b7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,3 @@ - require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts' @@ -34,3 +33,12 @@ RSpec.configure do |c| Puppet.settings[:strict] = :warning end end + +def ensure_module_defined(module_name) + module_name.split('::').reduce(Object) do |last_module, next_module| + last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module) + last_module.const_get(next_module) + end +end + +# 'spec_overrides' from sync.yml will appear below this line