summaryrefslogtreecommitdiff
path: root/spec/functional/win32/versions_spec.rb
diff options
context:
space:
mode:
authorChirag Jog <chirag.jog@gmail.com>2013-03-27 11:39:12 +1100
committeradamedx <adamed@opscode.com>2013-03-29 09:35:46 -0700
commit584c79291914386ad9d7fe2440d5a5b9dd6c0ffa (patch)
treef62421caa1b8c3a5de33b14d01faf571a2166b63 /spec/functional/win32/versions_spec.rb
parent4deb3555e8c15bd3320b029b2378a326867abc50 (diff)
downloadchef-584c79291914386ad9d7fe2440d5a5b9dd6c0ffa.tar.gz
Spec test to validate version.rb
Diffstat (limited to 'spec/functional/win32/versions_spec.rb')
-rw-r--r--spec/functional/win32/versions_spec.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/functional/win32/versions_spec.rb b/spec/functional/win32/versions_spec.rb
new file mode 100644
index 0000000000..96459f02f9
--- /dev/null
+++ b/spec/functional/win32/versions_spec.rb
@@ -0,0 +1,36 @@
+#
+# Author:: Chirag Jog (<chirag@clogeny.com>)
+# Copyright:: Copyright (c) 2013 Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+if Chef::Platform.windows?
+ require 'chef/win32/version'
+ require 'ruby-wmi'
+end
+
+describe "Chef::ReservedNames::Win32::Version", :windows_only do
+ before do
+ @host = WMI::Win32_OperatingSystem.find(:first)
+ @current_os_version = @host.version
+ @version = Chef::ReservedNames::Win32::Version.new
+ end
+ context "Windows Operating System version" do
+ it "should match the version from WMI" do
+ @current_os_version.include?(@version.marketing_name).should == true
+ end
+ end
+end