Module: Kernel

Defined in:
lib/rspec-puppet/monkey_patches.rb

Overview

Prevent Puppet from requiring ‘puppet/util/windows’ if we’re pretending to be windows, otherwise it will require other libraries that probably won’t be available on non-windows hosts.

Instance Method Summary collapse

Instance Method Details

#old_requireObject



316
# File 'lib/rspec-puppet/monkey_patches.rb', line 316

alias :old_require :require

#require(path) ⇒ Object



317
318
319
320
# File 'lib/rspec-puppet/monkey_patches.rb', line 317

def require(path)
  return if (['puppet/util/windows', 'win32/registry'].include?(path)) && RSpec::Puppet.rspec_puppet_example? && Puppet::Util::Platform.pretend_windows?
  old_require(path)
end