diff options
author | Tim Smith <tsmith@chef.io> | 2017-12-19 14:00:18 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2017-12-21 12:09:33 -0800 |
commit | bbd9888e5347708a976492a11e0e18be3a6ba158 (patch) | |
tree | 84aaf95a4ba579ad16b08bc7a20ae64eca23ba03 | |
parent | 37bacbbc9d6ca124af631acf72109a992b255e6a (diff) | |
download | chef-bbd9888e5347708a976492a11e0e18be3a6ba158.tar.gz |
Modernize windows_path resource
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/resource/windows_path.rb | 10 | ||||
-rw-r--r-- | spec/unit/resource/windows_path_spec.rb | 2 |
2 files changed, 2 insertions, 10 deletions
diff --git a/lib/chef/resource/windows_path.rb b/lib/chef/resource/windows_path.rb index 9274415755..a8a882d4c1 100644 --- a/lib/chef/resource/windows_path.rb +++ b/lib/chef/resource/windows_path.rb @@ -24,20 +24,12 @@ class Chef # # @since 13.4 class WindowsPath < Chef::Resource - + resource_name :windows_path provides :windows_path, os: "windows" allowed_actions :add, :remove default_action :add - def initialize(name, run_context = nil) - super - @resource_name = :windows_path - @path = name - @provider = Chef::Provider::WindowsPath - @action = :add - end - property :path, String, name_property: true end end diff --git a/spec/unit/resource/windows_path_spec.rb b/spec/unit/resource/windows_path_spec.rb index bde39fec9e..8f29a11e4e 100644 --- a/spec/unit/resource/windows_path_spec.rb +++ b/spec/unit/resource/windows_path_spec.rb @@ -30,7 +30,7 @@ describe Chef::Resource::WindowsPath do end it "sets the default action as :add" do - expect(resource.action).to eql(:add) + expect(resource.action).to eql([:add]) end it "supports :add and :remove actions" do |