summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-07-24 11:16:57 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-07-24 11:16:57 -0700
commit41822debf8c86d38e046cc7b7e70a06d9bc2ebc5 (patch)
treed2b35800ddcce1266386f1b83f01d62dae5416e9 /lib
parent9954314726362b4bc7ce23b8330802c3c0a7fc77 (diff)
downloadchef-41822debf8c86d38e046cc7b7e70a06d9bc2ebc5.tar.gz
the require needs to not be lazy
the lazy require here trolls the stubstatic file stubbing that we do in all the file provider spec tests. change it to be eager requiring, but we need to protect it so it only gets required on windows.
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/mixin/file_class.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/chef/mixin/file_class.rb b/lib/chef/mixin/file_class.rb
index f6a663daed..6dfabbe714 100644
--- a/lib/chef/mixin/file_class.rb
+++ b/lib/chef/mixin/file_class.rb
@@ -18,13 +18,16 @@
# limitations under the License.
#
+if Chef::Platform.windows?
+ require 'chef/win32/file'
+end
+
class Chef
module Mixin
module FileClass
def file_class
@host_os_file ||= if Chef::Platform.windows?
- require 'chef/win32/file'
Chef::ReservedNames::Win32::File
else
::File