chef 17.7.29-universal-mingw32 → 17.9.42-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (322) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -3
  3. data/README.md +1 -1
  4. data/distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll +0 -0
  5. data/distro/ruby_bin_folder/AMD64/Chef.PowerShell.dll +0 -0
  6. data/distro/ruby_bin_folder/AMD64/Ijwhost.dll +0 -0
  7. data/distro/ruby_bin_folder/AMD64/concrt140.dll +0 -0
  8. data/distro/ruby_bin_folder/AMD64/host/fxr/5.0.0/hostfxr.dll +0 -0
  9. data/distro/ruby_bin_folder/AMD64/msvcp140.dll +0 -0
  10. data/distro/ruby_bin_folder/AMD64/msvcp140_1.dll +0 -0
  11. data/distro/ruby_bin_folder/AMD64/msvcp140_2.dll +0 -0
  12. data/distro/ruby_bin_folder/AMD64/msvcp140_atomic_wait.dll +0 -0
  13. data/distro/ruby_bin_folder/AMD64/msvcp140_codecvt_ids.dll +0 -0
  14. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
  15. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll +0 -0
  16. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb +0 -0
  17. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Ijwhost.dll +0 -0
  18. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CSharp.dll +0 -0
  19. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json +180 -180
  20. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.Core.dll +0 -0
  21. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.dll +0 -0
  22. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Primitives.dll +0 -0
  23. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.dll +0 -0
  24. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.AppContext.dll +0 -0
  25. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Buffers.dll +0 -0
  26. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Concurrent.dll +0 -0
  27. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Immutable.dll +0 -0
  28. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.NonGeneric.dll +0 -0
  29. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Specialized.dll +0 -0
  30. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.dll +0 -0
  31. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Annotations.dll +0 -0
  32. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.DataAnnotations.dll +0 -0
  33. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.EventBasedAsync.dll +0 -0
  34. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Primitives.dll +0 -0
  35. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.TypeConverter.dll +0 -0
  36. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.dll +0 -0
  37. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.dll +0 -0
  38. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Console.dll +0 -0
  39. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Core.dll +0 -0
  40. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.Common.dll +0 -0
  41. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.DataSetExtensions.dll +0 -0
  42. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.dll +0 -0
  43. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dll +0 -0
  44. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dll +0 -0
  45. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dll +0 -0
  46. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dll +0 -0
  47. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dll +0 -0
  48. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.StackTrace.dll +0 -0
  49. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TextWriterTraceListener.dll +0 -0
  50. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tools.dll +0 -0
  51. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TraceSource.dll +0 -0
  52. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tracing.dll +0 -0
  53. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Primitives.dll +0 -0
  54. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.dll +0 -0
  55. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Dynamic.Runtime.dll +0 -0
  56. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Formats.Asn1.dll +0 -0
  57. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Calendars.dll +0 -0
  58. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Extensions.dll +0 -0
  59. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.dll +0 -0
  60. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.Brotli.dll +0 -0
  61. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.FileSystem.dll +0 -0
  62. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.ZipFile.dll +0 -0
  63. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.dll +0 -0
  64. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.AccessControl.dll +0 -0
  65. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.DriveInfo.dll +0 -0
  66. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Primitives.dll +0 -0
  67. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Watcher.dll +0 -0
  68. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.dll +0 -0
  69. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.IsolatedStorage.dll +0 -0
  70. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.MemoryMappedFiles.dll +0 -0
  71. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.AccessControl.dll +0 -0
  72. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.dll +0 -0
  73. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.UnmanagedMemoryStream.dll +0 -0
  74. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.dll +0 -0
  75. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Expressions.dll +0 -0
  76. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Parallel.dll +0 -0
  77. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Queryable.dll +0 -0
  78. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.dll +0 -0
  79. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Memory.dll +0 -0
  80. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.Json.dll +0 -0
  81. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.dll +0 -0
  82. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.HttpListener.dll +0 -0
  83. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Mail.dll +0 -0
  84. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NameResolution.dll +0 -0
  85. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NetworkInformation.dll +0 -0
  86. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Ping.dll +0 -0
  87. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Primitives.dll +0 -0
  88. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Requests.dll +0 -0
  89. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Security.dll +0 -0
  90. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.ServicePoint.dll +0 -0
  91. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Sockets.dll +0 -0
  92. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebClient.dll +0 -0
  93. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebHeaderCollection.dll +0 -0
  94. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebProxy.dll +0 -0
  95. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.Client.dll +0 -0
  96. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.dll +0 -0
  97. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.dll +0 -0
  98. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.Vectors.dll +0 -0
  99. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.dll +0 -0
  100. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ObjectModel.dll +0 -0
  101. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.CoreLib.dll +0 -0
  102. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.DataContractSerialization.dll +0 -0
  103. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Uri.dll +0 -0
  104. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.Linq.dll +0 -0
  105. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.dll +0 -0
  106. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.DispatchProxy.dll +0 -0
  107. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.ILGeneration.dll +0 -0
  108. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.Lightweight.dll +0 -0
  109. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.dll +0 -0
  110. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Extensions.dll +0 -0
  111. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Metadata.dll +0 -0
  112. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Primitives.dll +0 -0
  113. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.TypeExtensions.dll +0 -0
  114. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.dll +0 -0
  115. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Reader.dll +0 -0
  116. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.ResourceManager.dll +0 -0
  117. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Writer.dll +0 -0
  118. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.Unsafe.dll +0 -0
  119. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.VisualC.dll +0 -0
  120. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Extensions.dll +0 -0
  121. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Handles.dll +0 -0
  122. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.RuntimeInformation.dll +0 -0
  123. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.dll +0 -0
  124. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Intrinsics.dll +0 -0
  125. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Loader.dll +0 -0
  126. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Numerics.dll +0 -0
  127. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Formatters.dll +0 -0
  128. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Json.dll +0 -0
  129. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Primitives.dll +0 -0
  130. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Xml.dll +0 -0
  131. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.dll +0 -0
  132. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.dll +0 -0
  133. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.AccessControl.dll +0 -0
  134. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Claims.dll +0 -0
  135. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Algorithms.dll +0 -0
  136. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Cng.dll +0 -0
  137. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Csp.dll +0 -0
  138. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Encoding.dll +0 -0
  139. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.OpenSsl.dll +0 -0
  140. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Primitives.dll +0 -0
  141. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.X509Certificates.dll +0 -0
  142. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.Windows.dll +0 -0
  143. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.dll +0 -0
  144. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.SecureString.dll +0 -0
  145. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.dll +0 -0
  146. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceModel.Web.dll +0 -0
  147. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.dll +0 -0
  148. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.CodePages.dll +0 -0
  149. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.Extensions.dll +0 -0
  150. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.dll +0 -0
  151. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encodings.Web.dll +0 -0
  152. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Json.dll +0 -0
  153. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.RegularExpressions.dll +0 -0
  154. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Channels.dll +0 -0
  155. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Overlapped.dll +0 -0
  156. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Dataflow.dll +0 -0
  157. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Extensions.dll +0 -0
  158. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Parallel.dll +0 -0
  159. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.dll +0 -0
  160. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Thread.dll +0 -0
  161. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.ThreadPool.dll +0 -0
  162. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Timer.dll +0 -0
  163. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.dll +0 -0
  164. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.Local.dll +0 -0
  165. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.dll +0 -0
  166. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ValueTuple.dll +0 -0
  167. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.HttpUtility.dll +0 -0
  168. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.dll +0 -0
  169. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Windows.dll +0 -0
  170. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Linq.dll +0 -0
  171. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.ReaderWriter.dll +0 -0
  172. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Serialization.dll +0 -0
  173. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XDocument.dll +0 -0
  174. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.XDocument.dll +0 -0
  175. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.dll +0 -0
  176. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlDocument.dll +0 -0
  177. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlSerializer.dll +0 -0
  178. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.dll +0 -0
  179. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.dll +0 -0
  180. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/WindowsBase.dll +0 -0
  181. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrcompression.dll +0 -0
  182. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clretwrc.dll +0 -0
  183. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrjit.dll +0 -0
  184. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/coreclr.dll +0 -0
  185. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/createdump.exe +0 -0
  186. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/dbgshim.dll +0 -0
  187. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostfxr.dll +0 -0
  188. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostpolicy.dll +0 -0
  189. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore.dll +0 -0
  190. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_amd64_amd64_5.0.521.16609.dll +0 -0
  191. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordbi.dll +0 -0
  192. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorlib.dll +0 -0
  193. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorrc.dll +0 -0
  194. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/netstandard.dll +0 -0
  195. data/distro/ruby_bin_folder/AMD64/vccorlib140.dll +0 -0
  196. data/distro/ruby_bin_folder/AMD64/vcruntime140.dll +0 -0
  197. data/distro/ruby_bin_folder/AMD64/vcruntime140_1.dll +0 -0
  198. data/distro/ruby_bin_folder/x86/Chef.PowerShell.dll +0 -0
  199. data/distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll +0 -0
  200. data/distro/ruby_bin_folder/x86/concrt140.dll +0 -0
  201. data/distro/ruby_bin_folder/x86/msvcp140.dll +0 -0
  202. data/distro/ruby_bin_folder/x86/msvcp140_1.dll +0 -0
  203. data/distro/ruby_bin_folder/x86/msvcp140_2.dll +0 -0
  204. data/distro/ruby_bin_folder/x86/msvcp140_atomic_wait.dll +0 -0
  205. data/distro/ruby_bin_folder/x86/msvcp140_codecvt_ids.dll +0 -0
  206. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
  207. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll +0 -0
  208. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb +0 -0
  209. data/distro/ruby_bin_folder/x86/vccorlib140.dll +0 -0
  210. data/distro/ruby_bin_folder/x86/vcruntime140.dll +0 -0
  211. data/lib/chef/application/base.rb +1 -1
  212. data/lib/chef/application/exit_code.rb +7 -21
  213. data/lib/chef/chef_fs/file_system/chef_server/cookbook_file.rb +1 -1
  214. data/lib/chef/chef_fs/file_system/repository/base_file.rb +1 -1
  215. data/lib/chef/chef_fs/file_system/repository/file_system_entry.rb +1 -1
  216. data/lib/chef/compliance/default_attributes.rb +12 -2
  217. data/lib/chef/compliance/input_collection.rb +1 -1
  218. data/lib/chef/compliance/runner.rb +51 -5
  219. data/lib/chef/compliance/waiver_collection.rb +1 -1
  220. data/lib/chef/cookbook/syntax_check.rb +1 -1
  221. data/lib/chef/cookbook_uploader.rb +1 -1
  222. data/lib/chef/cookbook_version.rb +1 -1
  223. data/lib/chef/mixin/powershell_exec.rb +6 -5
  224. data/lib/chef/mixin/why_run.rb +8 -2
  225. data/lib/chef/powershell.rb +8 -6
  226. data/lib/chef/provider/cron.rb +2 -2
  227. data/lib/chef/provider/directory.rb +2 -2
  228. data/lib/chef/provider/ifconfig.rb +5 -5
  229. data/lib/chef/provider/mount/linux.rb +16 -2
  230. data/lib/chef/provider/mount/mount.rb +1 -1
  231. data/lib/chef/provider/package/dnf.rb +1 -1
  232. data/lib/chef/provider/package/powershell.rb +13 -10
  233. data/lib/chef/provider/package/yum/python_helper.rb +81 -25
  234. data/lib/chef/provider/package/yum.rb +39 -12
  235. data/lib/chef/provider/package/zypper.rb +2 -0
  236. data/lib/chef/provider/package.rb +63 -28
  237. data/lib/chef/provider/user/mac.rb +3 -3
  238. data/lib/chef/provider.rb +5 -2
  239. data/lib/chef/providers.rb +0 -1
  240. data/lib/chef/pwsh.rb +3 -2
  241. data/lib/chef/resource/apt_package.rb +2 -2
  242. data/lib/chef/resource/chef_client_config.rb +21 -1
  243. data/lib/chef/resource/chef_client_launchd.rb +1 -1
  244. data/lib/chef/resource/chocolatey_package.rb +3 -3
  245. data/lib/chef/resource/cron/cron.rb +75 -1
  246. data/lib/chef/resource/cron/cron_d.rb +2 -1
  247. data/lib/chef/resource/dnf_package.rb +4 -6
  248. data/lib/chef/resource/dpkg_package.rb +5 -0
  249. data/lib/chef/resource/execute.rb +1 -4
  250. data/lib/chef/resource/habitat/habitat_sup.rb +1 -1
  251. data/lib/chef/resource/habitat/habitat_sup_windows.rb +1 -1
  252. data/lib/chef/resource/homebrew_tap.rb +1 -5
  253. data/lib/chef/resource/inspec_waiver_file_entry.rb +1 -1
  254. data/lib/chef/resource/launchd.rb +2 -5
  255. data/lib/chef/resource/lwrp_base.rb +1 -1
  256. data/lib/chef/resource/macos_userdefaults.rb +5 -7
  257. data/lib/chef/resource/powershell_package_source.rb +8 -8
  258. data/lib/chef/resource/remote_file.rb +1 -1
  259. data/lib/chef/resource/rhsm_register.rb +31 -0
  260. data/lib/chef/resource/support/client.erb +7 -0
  261. data/lib/chef/resource/windows_feature_powershell.rb +8 -9
  262. data/lib/chef/resource/windows_task.rb +25 -10
  263. data/lib/chef/resource.rb +3 -3
  264. data/lib/chef/resource_reporter.rb +1 -1
  265. data/lib/chef/run_lock.rb +1 -1
  266. data/lib/chef/secret_fetcher/azure_key_vault.rb +4 -2
  267. data/lib/chef/secret_fetcher/hashi_vault.rb +37 -3
  268. data/lib/chef/util/dsc/configuration_generator.rb +1 -1
  269. data/lib/chef/version.rb +1 -1
  270. data/spec/functional/resource/cookbook_file_spec.rb +1 -1
  271. data/spec/functional/resource/dnf_package_spec.rb +138 -124
  272. data/spec/functional/resource/dpkg_package_spec.rb +16 -0
  273. data/spec/functional/resource/dsc_script_spec.rb +2 -2
  274. data/spec/functional/resource/macos_userdefaults_spec.rb +20 -0
  275. data/spec/functional/resource/template_spec.rb +1 -1
  276. data/spec/functional/resource/yum_package_spec.rb +789 -129
  277. data/spec/functional/resource/zypper_package_spec.rb +7 -0
  278. data/spec/integration/client/client_spec.rb +32 -1
  279. data/spec/spec_helper.rb +3 -3
  280. data/spec/support/platform_helpers.rb +1 -1
  281. data/spec/support/ruby_installer.rb +1 -1
  282. data/spec/support/shared/functional/file_resource.rb +2 -2
  283. data/spec/support/shared/functional/http.rb +9 -9
  284. data/spec/support/shared/unit/provider/useradd_based_user_provider.rb +1 -1
  285. data/spec/unit/application/base_spec.rb +40 -0
  286. data/spec/unit/compliance/runner_spec.rb +62 -1
  287. data/spec/unit/dsl/registry_helper_spec.rb +6 -6
  288. data/spec/unit/file_access_control_spec.rb +1 -1
  289. data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +1 -1
  290. data/spec/unit/lwrp_spec.rb +2 -2
  291. data/spec/unit/mixin/why_run_spec.rb +53 -0
  292. data/spec/unit/provider/dsc_script_spec.rb +8 -8
  293. data/spec/unit/provider/group/groupadd_spec.rb +1 -0
  294. data/spec/unit/provider/group/usermod_spec.rb +4 -4
  295. data/spec/unit/provider/ifconfig/aix_spec.rb +14 -14
  296. data/spec/unit/provider/ifconfig/debian_spec.rb +1 -1
  297. data/spec/unit/provider/ifconfig/redhat_spec.rb +1 -1
  298. data/spec/unit/provider/ifconfig_spec.rb +5 -3
  299. data/spec/unit/provider/mount/linux_spec.rb +16 -3
  300. data/spec/unit/provider/package/bff_spec.rb +1 -0
  301. data/spec/unit/provider/package/powershell_spec.rb +114 -114
  302. data/spec/unit/provider/package/rubygems_spec.rb +3 -0
  303. data/spec/unit/provider/package/solaris_spec.rb +1 -0
  304. data/spec/unit/provider/remote_file/cache_control_data_spec.rb +3 -3
  305. data/spec/unit/provider/service/arch_service_spec.rb +2 -2
  306. data/spec/unit/provider/service/debian_service_spec.rb +1 -0
  307. data/spec/unit/provider/service/gentoo_service_spec.rb +3 -2
  308. data/spec/unit/provider/service/macosx_spec.rb +1 -0
  309. data/spec/unit/provider/service/redhat_spec.rb +4 -1
  310. data/spec/unit/provider/service/simple_service_spec.rb +6 -4
  311. data/spec/unit/provider/service/upstart_service_spec.rb +3 -3
  312. data/spec/unit/provider/user/solaris_spec.rb +1 -1
  313. data/spec/unit/provider/user_spec.rb +2 -0
  314. data/spec/unit/resource/conditional_spec.rb +4 -4
  315. data/spec/unit/resource/dpkg_package_spec.rb +12 -0
  316. data/spec/unit/resource/rhsm_register_spec.rb +42 -0
  317. data/spec/unit/resource_spec.rb +2 -2
  318. data/spec/unit/secret_fetcher/hashi_vault_spec.rb +46 -0
  319. metadata +10 -10
  320. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_amd64_amd64_5.0.20.51904.dll +0 -0
  321. data/lib/chef/provider/group/suse.rb +0 -82
  322. data/spec/unit/provider/group/suse_spec.rb +0 -90
@@ -35,7 +35,7 @@ describe Chef::Provider::Ifconfig do
35
35
  @current_resource = Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)
36
36
 
37
37
  status = double("Status", exitstatus: 0)
38
- @provider.instance_variable_set("@status", status)
38
+ @provider.instance_variable_set(:@status, status)
39
39
  @provider.current_resource = @current_resource
40
40
  end
41
41
 
@@ -58,9 +58,10 @@ describe Chef::Provider::Ifconfig do
58
58
  @provider.load_current_resource
59
59
  end
60
60
  it "should track state of ifconfig failure" do
61
- expect(@provider.instance_variable_get("@status").exitstatus).not_to eq(0)
61
+ expect(@provider.instance_variable_get(:@status).exitstatus).not_to eq(0)
62
62
  end
63
63
  it "should thrown an exception when ifconfig fails" do
64
+ @provider.action = :add
64
65
  @provider.define_resource_requirements
65
66
  expect { @provider.process_resource_requirements }.to raise_error Chef::Exceptions::Ifconfig
66
67
  end
@@ -78,9 +79,10 @@ describe Chef::Provider::Ifconfig do
78
79
  @provider.load_current_resource
79
80
  end
80
81
  it "should track state of ifconfig failure" do
81
- expect(@provider.instance_variable_get("@status").exitstatus).not_to eq(0)
82
+ expect(@provider.instance_variable_get(:@status).exitstatus).not_to eq(0)
82
83
  end
83
84
  it "should thrown an exception when ifconfig fails" do
85
+ @provider.action = :add
84
86
  @provider.define_resource_requirements
85
87
  expect { @provider.process_resource_requirements }.to raise_error Chef::Exceptions::Ifconfig
86
88
  end
@@ -10,9 +10,9 @@ describe Chef::Provider::Mount::Linux do
10
10
 
11
11
  let(:new_resource) do
12
12
  new_resource = Chef::Resource::Mount.new("/tmp/foo")
13
- new_resource.device "/dev/sdz1"
13
+ new_resource.device "/dev/sdz1"
14
14
  new_resource.device_type :device
15
- new_resource.fstype "ext3"
15
+ new_resource.fstype "ext3"
16
16
  new_resource.supports remount: false
17
17
  new_resource
18
18
  end
@@ -32,6 +32,7 @@ describe Chef::Provider::Mount::Linux do
32
32
  context "to see if the volume is mounted" do
33
33
 
34
34
  it "should set mounted true if the mount point is found in the mounts list" do
35
+ allow(provider).to receive(:shell_out!).with("losetup --list").and_return(double(stdout: "/tmp/foo"))
35
36
  allow(provider).to receive(:shell_out!).and_return(double(stdout: "/tmp/foo /dev/sdz1 type ext3 (rw)\n"))
36
37
  provider.load_current_resource
37
38
  expect(provider.current_resource.mounted).to be_truthy
@@ -104,4 +105,16 @@ describe Chef::Provider::Mount::Linux do
104
105
  end
105
106
  end
106
107
 
107
- end
108
+ context "to check if loop resource is mounted" do
109
+ it "should set mounted true in case of loop resource" do
110
+ new_resource.options "loop"
111
+ mount = "/tmp/foo /dev/loop16 iso660 cifs ro\n"
112
+ losetup = "/dev/loop16 0 0 1 1 /dev/sdz1 \n"
113
+ allow(provider).to receive(:shell_out!).with("findmnt -rn").and_return(double(stdout: mount))
114
+ allow(provider).to receive(:shell_out!).with("losetup -a").and_return(double(stdout: losetup))
115
+ provider.load_current_resource
116
+ expect(provider.current_resource.mounted).to be_truthy
117
+ end
118
+ end
119
+
120
+ end
@@ -61,6 +61,7 @@ describe Chef::Provider::Package::Bff do
61
61
  allow(@provider).to receive(:shell_out_compacted).and_return(@empty_status)
62
62
  allow(::File).to receive(:exist?).with(@new_resource.source).and_return(false)
63
63
  @provider.load_current_resource
64
+ @provider.action = :install
64
65
  @provider.define_resource_requirements
65
66
  expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Package)
66
67
  end
@@ -17,10 +17,10 @@
17
17
  #
18
18
 
19
19
  require "spec_helper"
20
- require "chef/mixin/powershell_out"
20
+ require "chef/mixin/powershell_exec"
21
21
 
22
22
  describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
23
- include Chef::Mixin::PowershellOut
23
+ include Chef::Mixin::PowershellExec
24
24
  let(:timeout) { 900 }
25
25
  let(:source) { nil }
26
26
 
@@ -35,63 +35,63 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
35
35
  end
36
36
 
37
37
  let(:package_xcertificate_installed) do
38
- double("powershell_out", stdout: "2.1.0.0\r\n")
38
+ double("powershell_exec", result: "2.1.0.0\r\n")
39
39
  end
40
40
 
41
41
  let(:package_xcertificate_installed_2_0_0_0) do
42
- double("powershell_out", stdout: "2.0.0.0\r\n")
42
+ double("powershell_exec", result: "2.0.0.0\r\n")
43
43
  end
44
44
 
45
45
  let(:package_xcertificate_available) do
46
- double("powershell_out", stdout: "2.1.0.0\r\n")
46
+ double("powershell_exec", result: "2.1.0.0\r\n")
47
47
  end
48
48
 
49
49
  let(:package_xcertificate_available_2_0_0_0) do
50
- double("powershell_out", stdout: "2.0.0.0\r\n")
50
+ double("powershell_exec", result: "2.0.0.0\r\n")
51
51
  end
52
52
 
53
53
  let(:package_xcertificate_not_installed) do
54
- double("powershell_out", stdout: "")
54
+ double("powershell_exec", result: "")
55
55
  end
56
56
 
57
57
  let(:package_xcertificate_not_available) do
58
- double("powershell_out", stdout: "")
58
+ double("powershell_exec", result: "")
59
59
  end
60
60
 
61
61
  let(:package_xnetworking_installed) do
62
- double("powershell_out", stdout: "2.12.0.0\r\n")
62
+ double("powershell_exec", result: "2.12.0.0\r\n")
63
63
  end
64
64
 
65
65
  let(:package_xnetworking_installed_2_11_0_0) do
66
- double("powershell_out", stdout: "2.11.0.0\r\n")
66
+ double("powershell_exec", result: "2.11.0.0\r\n")
67
67
  end
68
68
 
69
69
  let(:package_xnetworking_available) do
70
- double("powershell_out", stdout: "2.12.0.0\r\n")
70
+ double("powershell_exec", result: "2.12.0.0\r\n")
71
71
  end
72
72
 
73
73
  let(:package_xnetworking_available_2_11_0_0) do
74
- double("powershell_out", stdout: "2.11.0.0\r\n")
74
+ double("powershell_exec", result: "2.11.0.0\r\n")
75
75
  end
76
76
 
77
77
  let(:package_xnetworking_not_installed) do
78
- double("powershell_out", stdout: "")
78
+ double("powershell_exec", result: "")
79
79
  end
80
80
 
81
81
  let(:package_xnetworking_not_available) do
82
- double("powershell_out", stdout: "")
82
+ double("powershell_exec", result: "")
83
83
  end
84
84
 
85
85
  let(:package_7zip_available) do
86
- double("powershell_out", stdout: "16.02\r\n")
86
+ double("powershell_exec", result: "16.02\r\n")
87
87
  end
88
88
 
89
89
  let(:package_7zip_not_installed) do
90
- double("powershell_out", stdout: "")
90
+ double("powershell_exec", result: "")
91
91
  end
92
92
 
93
93
  let(:powershell_installed_version) do
94
- double("powershell_out", stdout: "5")
94
+ double("powershell_exec", result: "5")
95
95
  end
96
96
 
97
97
  let(:tls_set_command) { "if ([Net.ServicePointManager]::SecurityProtocol -lt [Net.SecurityProtocolType]::Tls12) { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 };" }
@@ -122,14 +122,14 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
122
122
  describe "#candidate_version" do
123
123
 
124
124
  it "should set the candidate_version to the latest version when not pinning" do
125
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
125
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
126
126
  new_resource.package_name(["xNetworking"])
127
127
  new_resource.version(nil)
128
128
  expect(provider.candidate_version).to eql(["2.12.0.0"])
129
129
  end
130
130
 
131
131
  it "should use the candidate_version from the correct source" do
132
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
132
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
133
133
  new_resource.package_name(["xNetworking"])
134
134
  new_resource.version(nil)
135
135
  new_resource.source("MyGallery")
@@ -137,60 +137,60 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
137
137
  end
138
138
 
139
139
  it "should set the candidate_version to the latest version when not pinning and package name is space separated" do
140
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_available)
140
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_available)
141
141
  new_resource.package_name(["7-Zip 16.02 (x64)"])
142
142
  new_resource.version(nil)
143
143
  expect(provider.candidate_version).to eql(["16.02"])
144
144
  end
145
145
 
146
146
  it "should set the candidate_version to pinned version if available" do
147
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.0.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available_2_0_0_0)
147
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.0.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available_2_0_0_0)
148
148
  new_resource.package_name(["xCertificate"])
149
149
  new_resource.version(["2.0.0.0"])
150
150
  expect(provider.candidate_version).to eql(["2.0.0.0"])
151
151
  end
152
152
 
153
153
  it "should set the candidate_version to nil if there is no candidate" do
154
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
154
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
155
155
  new_resource.package_name(["xCertificate"])
156
156
  expect(provider.candidate_version).to eql([nil])
157
157
  end
158
158
 
159
159
  it "should set the candidate_version correctly when there are two packages to install" do
160
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
161
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
160
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
161
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
162
162
  new_resource.package_name(%w{xCertificate xNetworking})
163
163
  new_resource.version(nil)
164
164
  expect(provider.candidate_version).to eql(["2.1.0.0", "2.12.0.0"])
165
165
  end
166
166
 
167
167
  it "should set the candidate_version correctly when only the first is installable" do
168
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
169
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
168
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
169
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
170
170
  new_resource.package_name(%w{xCertificate xNetworking})
171
171
  new_resource.version(nil)
172
172
  expect(provider.candidate_version).to eql(["2.1.0.0", nil])
173
173
  end
174
174
 
175
175
  it "should set the candidate_version correctly when only the last is installable" do
176
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
177
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
176
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
177
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
178
178
  new_resource.package_name(%w{xCertificate xNetworking})
179
179
  new_resource.version(nil)
180
180
  expect(provider.candidate_version).to eql([nil, "2.12.0.0"])
181
181
  end
182
182
 
183
183
  it "should set the candidate_version correctly when neither are is installable and version is passed as nil array" do
184
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
185
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
184
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
185
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
186
186
  new_resource.package_name(%w{xNetworking xCertificate})
187
187
  new_resource.version([nil, nil])
188
188
  expect(provider.candidate_version).to eql([nil, nil])
189
189
  end
190
190
 
191
191
  it "should set the candidate_version correctly when neither are is installable and version is not passed" do
192
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
193
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
192
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
193
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
194
194
  new_resource.package_name(%w{xNetworking xCertificate})
195
195
  new_resource.version(nil)
196
196
  expect(provider.candidate_version).to eql([nil, nil])
@@ -322,10 +322,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
322
322
  provider.load_current_resource
323
323
  new_resource.package_name(["xCertificate"])
324
324
  new_resource.version(nil)
325
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
326
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
327
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
328
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
325
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
326
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
327
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
328
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
329
329
  provider.run_action(:install)
330
330
  expect(new_resource).to be_updated_by_last_action
331
331
  end
@@ -335,10 +335,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
335
335
  new_resource.package_name(["xCertificate"])
336
336
  new_resource.version(nil)
337
337
  new_resource.source("MyGallery")
338
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
339
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
340
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
341
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout })
338
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
339
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
340
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
341
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout })
342
342
  provider.run_action(:install)
343
343
  expect(new_resource).to be_updated_by_last_action
344
344
  end
@@ -348,10 +348,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
348
348
  new_resource.package_name(["xCertificate"])
349
349
  new_resource.version(nil)
350
350
  new_resource.skip_publisher_check(true)
351
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
352
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -SkipPublisherCheck ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
353
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
354
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -SkipPublisherCheck ).Version", { timeout: new_resource.timeout })
351
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
352
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -SkipPublisherCheck ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
353
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
354
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -SkipPublisherCheck ).Version", { timeout: new_resource.timeout })
355
355
  provider.run_action(:install)
356
356
  expect(new_resource).to be_updated_by_last_action
357
357
  end
@@ -360,10 +360,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
360
360
  provider.load_current_resource
361
361
  new_resource.package_name(["7-Zip 16.02 (x64)"])
362
362
  new_resource.version(nil)
363
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_available)
364
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_not_installed)
365
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
366
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 16.02 ).Version", { timeout: new_resource.timeout })
363
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_available)
364
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_not_installed)
365
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
366
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 16.02 ).Version", { timeout: new_resource.timeout })
367
367
  provider.run_action(:install)
368
368
  expect(new_resource).to be_updated_by_last_action
369
369
  end
@@ -375,10 +375,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
375
375
  provider.load_current_resource
376
376
  new_resource.package_name(["xCertificate"])
377
377
  new_resource.version(nil)
378
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
379
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
380
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
381
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
378
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
379
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
380
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
381
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
382
382
  provider.run_action(:install)
383
383
  expect(new_resource).to be_updated_by_last_action
384
384
  end
@@ -387,9 +387,9 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
387
387
  it "should not install packages that are up-to-date" do
388
388
  new_resource.package_name(["xCertificate"])
389
389
  new_resource.version(nil)
390
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
391
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
392
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
390
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
391
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
392
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
393
393
  provider.load_current_resource
394
394
  expect(provider).not_to receive(:install_package)
395
395
  provider.run_action(:install)
@@ -399,9 +399,9 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
399
399
  it "should not install packages that are up-to-date" do
400
400
  new_resource.package_name(["xNetworking"])
401
401
  new_resource.version(["2.11.0.0"])
402
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
403
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available_2_11_0_0)
404
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
402
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
403
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available_2_11_0_0)
404
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
405
405
  provider.load_current_resource
406
406
  expect(provider).not_to receive(:install_package)
407
407
  provider.run_action(:install)
@@ -413,13 +413,13 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
413
413
  # new_version.resource[0]
414
414
  new_resource.package_name(%w{xCertificate xNetworking})
415
415
  new_resource.version([nil, "2.11.0.0"])
416
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
417
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
418
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available_2_11_0_0)
419
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
420
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
421
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
422
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout })
416
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
417
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
418
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available_2_11_0_0)
419
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
420
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
421
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
422
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout })
423
423
  provider.load_current_resource
424
424
  provider.run_action(:install)
425
425
  expect(new_resource).to be_updated_by_last_action
@@ -428,13 +428,13 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
428
428
  it "should split up commands when given two packages, one with a version pin" do
429
429
  new_resource.package_name(%w{xCertificate xNetworking})
430
430
  new_resource.version(["2.1.0.0", nil])
431
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
432
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
433
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
434
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
435
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
436
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
437
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 ).Version", { timeout: new_resource.timeout })
431
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
432
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
433
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
434
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
435
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
436
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
437
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 ).Version", { timeout: new_resource.timeout })
438
438
 
439
439
  provider.load_current_resource
440
440
  provider.run_action(:install)
@@ -444,13 +444,13 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
444
444
  it "should do multipackage installs when given two packages without constraints" do
445
445
  new_resource.package_name(%w{xCertificate xNetworking})
446
446
  new_resource.version(nil)
447
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
448
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
449
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
450
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
451
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
452
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
453
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 ).Version", { timeout: new_resource.timeout })
447
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
448
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
449
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
450
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
451
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
452
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
453
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 ).Version", { timeout: new_resource.timeout })
454
454
  provider.load_current_resource
455
455
  provider.run_action(:install)
456
456
  expect(new_resource).to be_updated_by_last_action
@@ -460,13 +460,13 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
460
460
  new_resource.package_name(%w{xCertificate xNetworking})
461
461
  new_resource.version(nil)
462
462
  new_resource.source("MyGallery")
463
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
464
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
465
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
466
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
467
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
468
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout })
469
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout })
463
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
464
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
465
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
466
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
467
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
468
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout })
469
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout })
470
470
  provider.load_current_resource
471
471
  provider.run_action(:install)
472
472
  expect(new_resource).to be_updated_by_last_action
@@ -477,10 +477,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
477
477
  new_resource.package_name(["xCertificate"])
478
478
  new_resource.version(nil)
479
479
  new_resource.options(%w{-AcceptLicense -Verbose})
480
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
481
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
482
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
483
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -AcceptLicense -Verbose ).Version", { timeout: new_resource.timeout })
480
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
481
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
482
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
483
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -AcceptLicense -Verbose ).Version", { timeout: new_resource.timeout })
484
484
  provider.run_action(:install)
485
485
  expect(new_resource).to be_updated_by_last_action
486
486
  end
@@ -491,9 +491,9 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
491
491
  provider.load_current_resource
492
492
  new_resource.package_name(["xCertificate"])
493
493
  new_resource.version(["2.1.0.0"])
494
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
495
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
496
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
494
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
495
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
496
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
497
497
  expect(provider).not_to receive(:remove_package)
498
498
  provider.run_action(:remove)
499
499
  expect(new_resource).not_to be_updated_by_last_action
@@ -503,11 +503,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
503
503
  new_resource.package_name(["xCertificate"])
504
504
  new_resource.version(["2.1.0.0"])
505
505
  new_resource.source("MyGallery")
506
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
507
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
508
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
506
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
507
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
508
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
509
509
  provider.load_current_resource
510
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
510
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
511
511
  provider.run_action(:remove)
512
512
  expect(new_resource).to be_updated_by_last_action
513
513
  end
@@ -515,11 +515,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
515
515
  it "does nothing when all the packages are already removed" do
516
516
  new_resource.package_name(%w{xCertificate xNetworking})
517
517
  new_resource.version(nil)
518
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
519
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
520
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
521
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
522
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
518
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
519
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
520
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available)
521
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available)
522
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
523
523
  provider.load_current_resource
524
524
  expect(provider).not_to receive(:remove_package)
525
525
  provider.run_action(:remove)
@@ -529,11 +529,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
529
529
  it "removes a package when version is specified" do
530
530
  new_resource.package_name(["xCertificate"])
531
531
  new_resource.version(["2.1.0.0"])
532
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
533
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
534
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
532
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
533
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
534
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
535
535
  provider.load_current_resource
536
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
536
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout })
537
537
  provider.run_action(:remove)
538
538
  expect(new_resource).to be_updated_by_last_action
539
539
  end
@@ -541,11 +541,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
541
541
  it "removes a package when version is not specified" do
542
542
  new_resource.package_name(["xCertificate"])
543
543
  new_resource.version(nil)
544
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
545
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
546
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
544
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
545
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
546
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
547
547
  provider.load_current_resource
548
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
548
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
549
549
  provider.run_action(:remove)
550
550
  expect(new_resource).to be_updated_by_last_action
551
551
  end
@@ -553,11 +553,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
553
553
  it "should remove a package using provided options" do
554
554
  new_resource.package_name(["xCertificate"])
555
555
  new_resource.options(%w{-AllVersions})
556
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
557
- allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
558
- allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
556
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
557
+ allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available)
558
+ allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version)
559
559
  provider.load_current_resource
560
- expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -AllVersions ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
560
+ expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -AllVersions ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available)
561
561
  provider.run_action(:remove)
562
562
  expect(new_resource).to be_updated_by_last_action
563
563
  end
@@ -410,6 +410,9 @@ describe Chef::Provider::Package::Rubygems do
410
410
  # Rubygems uses these two interally
411
411
  allow(RbConfig::CONFIG).to receive(:[]).with("arch").and_call_original
412
412
  allow(RbConfig::CONFIG).to receive(:[]).with("ruby_install_name").and_call_original
413
+ allow(RbConfig::CONFIG).to receive(:[]).with("ruby_version").and_call_original
414
+ allow(RbConfig::CONFIG).to receive(:[]).with("rubylibprefix").and_call_original
415
+ allow(RbConfig::CONFIG).to receive(:[]).with("vendordir").and_call_original
413
416
  allow(File).to receive(:executable?).and_return false
414
417
  allow(File).to receive(:executable?).with("#{bindir}/gem").and_return true
415
418
  # XXX: we can't stub the provider object directly here because referencing it will create it and that