summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-12-19 11:36:42 -0800
committerTim Smith <tsmith@chef.io>2017-12-19 11:36:42 -0800
commit62068b35f7a03c1c0da9c8f213159c08a266d6f8 (patch)
tree6fb8e36a28dd9ed9997baeb8bc1af7596e0aa5e9
parent078b027bac17f0caf550290cd3adad5585e78f2b (diff)
downloadchef-resource_specs.tar.gz
Move zypper_repo tests out of linux only and cleanupresource_specs
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 <tsmith@chef.io>
-rw-r--r--spec/unit/resource/zypper_repository_spec.rb44
1 files 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"