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



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

alias old_require require

#require(path) ⇒ Object



395
396
397
398
399
400
# File 'lib/rspec-puppet/monkey_patches.rb', line 395

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