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



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

alias :old_require :require

#require(path) ⇒ Object



410
411
412
413
# File 'lib/rspec-puppet/monkey_patches.rb', line 410

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