summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-05-04 10:44:39 -0700
committerTim Smith <tsmith@chef.io>2017-05-12 09:29:33 -0700
commit29a28d37d481a850bdd63a8c2dc4a0e3c45b9f84 (patch)
tree4b46c5f8962fedadf01133376465374d0046ee93
parent1556de1044ae31f5a5ebba77972048314966214b (diff)
downloadchef-29a28d37d481a850bdd63a8c2dc4a0e3c45b9f84.tar.gz
Testing updates
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/apt_preference.rb2
-rw-r--r--spec/unit/resource/apt_preference_spec.rb10
2 files changed, 4 insertions, 8 deletions
diff --git a/lib/chef/resource/apt_preference.rb b/lib/chef/resource/apt_preference.rb
index 6fb313726a..603766d76b 100644
--- a/lib/chef/resource/apt_preference.rb
+++ b/lib/chef/resource/apt_preference.rb
@@ -21,7 +21,7 @@ require "chef/resource"
class Chef
class Resource
class AptPreference < Chef::Resource
- resource_name :apt_repository
+ resource_name :apt_preference
provides :apt_preference
property :package_name, String, name_property: true, regex: [/^([a-z]|[A-Z]|[0-9]|_|-|\.|\*|\+)+$/]
diff --git a/spec/unit/resource/apt_preference_spec.rb b/spec/unit/resource/apt_preference_spec.rb
index b71f2e3683..801434b4f3 100644
--- a/spec/unit/resource/apt_preference_spec.rb
+++ b/spec/unit/resource/apt_preference_spec.rb
@@ -29,17 +29,13 @@ describe Chef::Resource::AptPreference do
expect(resource).to be_a_kind_of(Chef::Resource::AptPreference)
end
- it "should resolve to a AptPreference class class when apt-get is found" do
- expect(Chef::Provider::AptPreference).to receive(:which).with("apt-get").and_return(true)
- expect(resource.provider_for_action(:add)).to be_a(Chef::Provider::AptPreference)
- end
-
it "should resolve to a Noop class when apt-get is not found" do
expect(Chef::Provider::AptPreference).to receive(:which).with("apt-get").and_return(false)
expect(resource.provider_for_action(:add)).to be_a(Chef::Provider::Noop)
end
- it "should resolve to a NoOp provider" do
- expect(resource.provider_for_action(:add)).to be_a(Chef::Provider::Noop)
+ it "should resolve to a AptPreference class when apt-get is found" do
+ expect(Chef::Provider::AptPreference).to receive(:which).with("apt-get").and_return(true)
+ expect(resource.provider_for_action(:add)).to be_a(Chef::Provider::AptPreference)
end
end