diff options
author | Adam Edwards <adamed@opscode.com> | 2014-05-02 09:22:40 -0700 |
---|---|---|
committer | sersut <serdar@opscode.com> | 2014-05-30 13:05:47 -0700 |
commit | 771662f8edc7f8251379f3207399bbdffa2248cc (patch) | |
tree | 8467ad262dd7618b22daa4f8b3d88e3359bf550c /spec/functional | |
parent | a6b19c08da6365e883d38d0ed202068df16301ab (diff) | |
download | chef-771662f8edc7f8251379f3207399bbdffa2248cc.tar.gz |
Re-implement ruby-wmi functionality
Diffstat (limited to 'spec/functional')
-rw-r--r-- | spec/functional/win32/versions_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/functional/win32/versions_spec.rb b/spec/functional/win32/versions_spec.rb index b983b711da..e1a12a4dc6 100644 --- a/spec/functional/win32/versions_spec.rb +++ b/spec/functional/win32/versions_spec.rb @@ -19,13 +19,13 @@ require 'spec_helper' if Chef::Platform.windows? require 'chef/win32/version' - require 'ruby-wmi' end describe "Chef::ReservedNames::Win32::Version", :windows_only, :not_supported_on_win2k3 do before do - host = WMI::Win32_OperatingSystem.find(:first) + wmi = Chef::ReservedNames::Win32::WMI.new + host = wmi.first_of('Win32_OperatingSystem') # Use WMI to determine current OS version. # On Win2k8R2 and later, we can dynamically obtain marketing @@ -44,7 +44,7 @@ describe "Chef::ReservedNames::Win32::Version", :windows_only, :not_supported_on # The name from WMI is actually what we want in Win2k8R2+. # So this expectation sould continue to hold without modification # as new versions of Windows are released. - @current_os_version = host.caption + @current_os_version = host['caption'] end @version = Chef::ReservedNames::Win32::Version.new @@ -98,7 +98,7 @@ describe "Chef::ReservedNames::Win32::Version", :windows_only, :not_supported_on def is_windows_server_2008?(wmi_host) is_win2k8 = false - os_version = wmi_host.send('Version') + os_version = wmi_host['version'] # The operating system version is a string in the following form # that can be split into components based on the '.' delimiter: |