| The file lib/puppet/util/windows.rb defines a set of constants that should be available on all platforms, such as {Puppet::Util::Windows, {Puppet::Util::Windows::Service and Puppet::Util::Windows::Service::DEFAULT_TIMEOUT. It also requires Windows-specific code that is only safe to load on Windows, because the code tries to load native libraries, such as user32.dll. The problem is when puppet is running on a non-Windows platform, then lib/puppet/util/windows.rb is never loaded. As a result, trying to test a service resource using rspec-puppet fails when trying to reference the Puppet::Util::Windows constant. See PDK-1760 for steps to reproduce. A quicker reproduction is:
bx ruby -e "require 'puppet'; puts Puppet::Util::Windows" |
Traceback (most recent call last): |
-e:1:in `<main>': uninitialized constant Puppet::Util::Windows (NameError)
|
|