diff options
author | Tim Smith <tsmith@chef.io> | 2017-12-18 17:13:44 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2017-12-18 17:17:08 -0800 |
commit | 13581a1c2e30950d68682bea2a9e36f9b51bc0ca (patch) | |
tree | 6955f7effd5810ec1733d47492b5357b34b04851 | |
parent | 17f85426ed747ce7ba3e56a2bce241b317fb99ae (diff) | |
download | chef-13581a1c2e30950d68682bea2a9e36f9b51bc0ca.tar.gz |
Improve the zypper_repository resource specs
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | spec/unit/resource/zypper_repository_spec.rb | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/spec/unit/resource/zypper_repository_spec.rb b/spec/unit/resource/zypper_repository_spec.rb index 9fac83086a..d18b83cc2d 100644 --- a/spec/unit/resource/zypper_repository_spec.rb +++ b/spec/unit/resource/zypper_repository_spec.rb @@ -25,19 +25,28 @@ describe Chef::Resource::ZypperRepository do let(:resource) { Chef::Resource::ZypperRepository.new("repo-source", run_context) } context "on linux", :linux_only do - it "creates a new Chef::Resource::ZypperRepository" do - expect(resource).to be_a_kind_of(Chef::Resource) - expect(resource).to be_a_kind_of(Chef::Resource::ZypperRepository) + it "has a resource_name of :zypper_repository" do + expect(resource.resource_name).to eq(:zypper_repository) end - it "has a name of repo-source" do - expect(resource.name).to eql("repo-source") + it "repo_name is the name_property" do + expect(resource.repo_name).to eql("repo-source") end it "has a default action of create" do expect(resource.action).to eql([:create]) end + it "aliases the uri property to baseurl" do + resource.uri = 'something' + expect(resource.baseurl).to eql('something') + end + + it "aliases the key property to gpgkey" do + resource.key = 'something' + expect(resource.gpgkey).to eql('something') + end + it "supports all valid actions" do expect { resource.action :add }.not_to raise_error expect { resource.action :remove }.not_to raise_error |