diff options
author | harikesh-kolekar <harikesh.kolekar@msystechnologies.com> | 2018-01-30 10:37:17 +0000 |
---|---|---|
committer | harikesh-kolekar <harikesh.kolekar@msystechnologies.com> | 2018-01-31 16:56:06 +0530 |
commit | ed4b10b43cf04c51232a99a818866af768241add (patch) | |
tree | e0e29b919a7af20fea68bd29fac87577ac70ccbf | |
parent | 85ad3ee585ab50d173c083325d106967d2161dab (diff) | |
download | chef-ed4b10b43cf04c51232a99a818866af768241add.tar.gz |
require file as per alphabetical order
Signed-off-by: harikesh-kolekar <harikesh.kolekar@msystechnologies.com>
-rw-r--r-- | lib/chef/provider/windows_env.rb | 5 | ||||
-rw-r--r-- | lib/chef/providers.rb | 3 | ||||
-rw-r--r-- | lib/chef/resources.rb | 1 | ||||
-rw-r--r-- | spec/unit/provider/windows_env_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/provider_resolver_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource/windows_env_spec.rb | 10 |
6 files changed, 9 insertions, 16 deletions
diff --git a/lib/chef/provider/windows_env.rb b/lib/chef/provider/windows_env.rb index 4cbcc8a478..b5b06666f3 100644 --- a/lib/chef/provider/windows_env.rb +++ b/lib/chef/provider/windows_env.rb @@ -26,6 +26,7 @@ class Chef include Chef::Mixin::WindowsEnvHelper attr_accessor :key_exists + provides :env, os: "windows" provides :windows_env, os: "windows" def whyrun_supported? @@ -51,10 +52,6 @@ class Chef current_resource end - def env_value(key_name) - raise Chef::Exceptions::WindowsEnv, "#{self} provider does not implement env_value!" - end - def env_key_exists(key_name) env_value(key_name) ? true : false end diff --git a/lib/chef/providers.rb b/lib/chef/providers.rb index 582f055260..8b07e1b405 100644 --- a/lib/chef/providers.rb +++ b/lib/chef/providers.rb @@ -27,8 +27,6 @@ require "chef/provider/cron/aix" require "chef/provider/directory" require "chef/provider/dsc_script" require "chef/provider/dsc_resource" -require "chef/provider/windows_env" -require "chef/provider/erl_call" require "chef/provider/execute" require "chef/provider/file" require "chef/provider/git" @@ -57,6 +55,7 @@ require "chef/provider/systemd_unit" require "chef/provider/template" require "chef/provider/user" require "chef/provider/whyrun_safe_ruby_block" +require "chef/provider/windows_env" require "chef/provider/yum_repository" require "chef/provider/windows_task" require "chef/provider/zypper_repository" diff --git a/lib/chef/resources.rb b/lib/chef/resources.rb index b250d8d4d5..b580a01c29 100644 --- a/lib/chef/resources.rb +++ b/lib/chef/resources.rb @@ -33,7 +33,6 @@ require "chef/resource/dpkg_package" require "chef/resource/dnf_package" require "chef/resource/dsc_script" require "chef/resource/dsc_resource" -require "chef/resource/erl_call" require "chef/resource/execute" require "chef/resource/file" require "chef/resource/freebsd_package" diff --git a/spec/unit/provider/windows_env_spec.rb b/spec/unit/provider/windows_env_spec.rb index 47a06d1d06..d648314dc1 100644 --- a/spec/unit/provider/windows_env_spec.rb +++ b/spec/unit/provider/windows_env_spec.rb @@ -328,7 +328,7 @@ describe Chef::Provider::WindowsEnv do new_resource end let(:provider) do - provider = Chef::Provider::WindowsEnv::Windows.new(new_resource, run_context) + provider = Chef::Provider::WindowsEnv.new(new_resource, run_context) allow(provider).to receive(:env_obj).and_return(double("null object").as_null_object) provider end @@ -380,7 +380,7 @@ describe Chef::Provider::WindowsEnv do new_resource end let(:provider) do - provider = Chef::Provider::WindowsEnv::Windows.new(new_resource, run_context) + provider = Chef::Provider::WindowsEnv.new(new_resource, run_context) allow(provider).to receive(:env_obj).and_return(double("null object").as_null_object) provider end diff --git a/spec/unit/provider_resolver_spec.rb b/spec/unit/provider_resolver_spec.rb index 9470bca929..ac641de43a 100644 --- a/spec/unit/provider_resolver_spec.rb +++ b/spec/unit/provider_resolver_spec.rb @@ -762,7 +762,7 @@ describe Chef::ProviderResolver do "windows" => { batch: [ Chef::Resource::Batch, Chef::Provider::Batch ], dsc_script: [ Chef::Resource::DscScript, Chef::Provider::DscScript ], - windows_env: [ Chef::Resource::WindowsEnv, Chef::Provider::WindowsEnv::Windows ], + windows_env: [ Chef::Resource::WindowsEnv, Chef::Provider::WindowsEnv ], group: [ Chef::Resource::Group, Chef::Provider::Group::Windows ], mount: [ Chef::Resource::Mount, Chef::Provider::Mount::Windows ], package: [ Chef::Resource::WindowsPackage, Chef::Provider::Package::Windows ], diff --git a/spec/unit/resource/windows_env_spec.rb b/spec/unit/resource/windows_env_spec.rb index b1052f045a..776e4f7cd5 100644 --- a/spec/unit/resource/windows_env_spec.rb +++ b/spec/unit/resource/windows_env_spec.rb @@ -21,17 +21,15 @@ require "spec_helper" describe Chef::Resource::WindowsEnv do - before(:each) do - @resource = Chef::Resource::WindowsEnv.new("FOO") - end + let(:resource) { Chef::Resource::WindowsEnv.new("FOO") } it "creates a new Chef::Resource::WindowsEnv" do - expect(@resource).to be_a_kind_of(Chef::Resource) - expect(@resource).to be_a_kind_of(Chef::Resource::WindowsEnv) + expect(resource).to be_a_kind_of(Chef::Resource) + expect(resource).to be_a_kind_of(Chef::Resource::WindowsEnv) end it "has a name" do - expect(@resource.name).to eql("FOO") + expect(resource.name).to eql("FOO") end it "has a default action of 'create'" do |