From 62068b35f7a03c1c0da9c8f213159c08a266d6f8 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 19 Dec 2017 11:36:42 -0800 Subject: Move zypper_repo tests out of linux only and cleanup The alias tests I added don't actually work, but everything was in linux only so I didn't notice. Move the things out of linux only that can run on any platform and remove the alias tests for now. Signed-off-by: Tim Smith --- spec/unit/resource/zypper_repository_spec.rb | 44 +++++++++++----------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/spec/unit/resource/zypper_repository_spec.rb b/spec/unit/resource/zypper_repository_spec.rb index 0758c2513f..889a1e1e9a 100644 --- a/spec/unit/resource/zypper_repository_spec.rb +++ b/spec/unit/resource/zypper_repository_spec.rb @@ -24,37 +24,27 @@ describe Chef::Resource::ZypperRepository do let(:run_context) { Chef::RunContext.new(node, {}, events) } let(:resource) { Chef::Resource::ZypperRepository.new("repo-source", run_context) } - context "on linux", :linux_only do - it "has a resource_name of :zypper_repository" do - expect(resource.resource_name).to eq(:zypper_repository) - end - - 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 "has a resource_name of :zypper_repository" do + expect(resource.resource_name).to eq(:zypper_repository) + end - it "aliases the uri property to baseurl" do - resource.uri = "something" - expect(resource.baseurl).to eql("something") - end + it "repo_name is the name_property" do + expect(resource.repo_name).to eql("repo-source") + end - it "aliases the key property to gpgkey" do - resource.key = "something" - expect(resource.gpgkey).to eql("something") - end + it "has a default action of create" do + expect(resource.action).to eql([:create]) + end - it "supports all valid actions" do - expect { resource.action :add }.not_to raise_error - expect { resource.action :remove }.not_to raise_error - expect { resource.action :create }.not_to raise_error - expect { resource.action :refresh }.not_to raise_error - expect { resource.action :delete }.to raise_error(ArgumentError) - end + it "supports all valid actions" do + expect { resource.action :add }.not_to raise_error + expect { resource.action :remove }.not_to raise_error + expect { resource.action :create }.not_to raise_error + expect { resource.action :refresh }.not_to raise_error + expect { resource.action :delete }.to raise_error(ArgumentError) + end + context "on linux", :linux_only do it "resolves to a Noop class when on non-linux OS" do node.automatic[:os] = "windows" node.automatic[:platform_family] = "windows" -- cgit v1.2.1