Skip to content

Commit

Permalink
Spec test to validate version.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
Chirag Jog committed Mar 27, 2013
1 parent 57a83a3 commit 631b4bd
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions spec/functional/win32/versions_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 631b4bd

Please sign in to comment.