diff options
author | Thom May <thom@may.lt> | 2015-06-19 10:01:06 +0100 |
---|---|---|
committer | Thom May <thom@may.lt> | 2015-06-19 10:01:06 +0100 |
commit | a8ab57add86e2198159a22ae63cae3855abe00d4 (patch) | |
tree | 2f2873691f775bb61d2abb68624fc2ab9610bea1 | |
parent | 442d1a277fc50cf28afb501fa0e9715ed21dba83 (diff) | |
parent | 20200ab5ed02fd9991ff82bb6f60d54835afc946 (diff) | |
download | chef-a8ab57add86e2198159a22ae63cae3855abe00d4.tar.gz |
Merge pull request #3554 from ranjib/fix_deps
Add missing require statement in resource_resolver
-rw-r--r-- | lib/chef/resource_resolver.rb | 1 | ||||
-rw-r--r-- | spec/unit/resource_resolver_spec.rb | 49 |
2 files changed, 50 insertions, 0 deletions
diff --git a/lib/chef/resource_resolver.rb b/lib/chef/resource_resolver.rb index 31b39f7e24..9df627beb2 100644 --- a/lib/chef/resource_resolver.rb +++ b/lib/chef/resource_resolver.rb @@ -18,6 +18,7 @@ require 'chef/exceptions' require 'chef/platform/resource_priority_map' +require 'chef/mixin/convert_to_class_name' class Chef class ResourceResolver diff --git a/spec/unit/resource_resolver_spec.rb b/spec/unit/resource_resolver_spec.rb new file mode 100644 index 0000000000..09ff026575 --- /dev/null +++ b/spec/unit/resource_resolver_spec.rb @@ -0,0 +1,49 @@ +# +# Author:: Ranjib Dey +# Copyright:: Copyright (c) 2015 Ranjib Dey <ranjib@linux.com>. +# 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' +require 'chef/resource_resolver' + + +describe Chef::ResourceResolver do + it '#resolve' do + expect(described_class.resolve(:execute)).to eq(Chef::Resource::Execute) + end + + it '#list' do + expect(described_class.list(:package)).to_not be_empty + end + + context 'instance methods' do + let(:resolver) do + described_class.new(Chef::Node.new, 'execute[echo]') + end + + it '#resolve' do + expect(resolver.resolve).to be_nil + end + + it '#list' do + expect(resolver.list).to be_empty + end + + it '#provided_by?' do + expect(resolver.provided_by?(Chef::Resource::Execute)).to be_truthy + end + end +end |