From 06ec15f2fbebb3ba7044c98776c8c9726320b13b Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Wed, 21 Mar 2018 13:58:16 -0700 Subject: Fix the openssl resource spec names Simple rename Signed-off-by: Tim Smith --- spec/unit/resource/openssl_rsa_private_key.rb | 59 ---------------------- spec/unit/resource/openssl_rsa_private_key_spec.rb | 59 ++++++++++++++++++++++ spec/unit/resource/openssl_rsa_public_key.rb | 39 -------------- spec/unit/resource/openssl_rsa_public_key_spec.rb | 39 ++++++++++++++ 4 files changed, 98 insertions(+), 98 deletions(-) delete mode 100644 spec/unit/resource/openssl_rsa_private_key.rb create mode 100644 spec/unit/resource/openssl_rsa_private_key_spec.rb delete mode 100644 spec/unit/resource/openssl_rsa_public_key.rb create mode 100644 spec/unit/resource/openssl_rsa_public_key_spec.rb (limited to 'spec') diff --git a/spec/unit/resource/openssl_rsa_private_key.rb b/spec/unit/resource/openssl_rsa_private_key.rb deleted file mode 100644 index 67bebf17fe..0000000000 --- a/spec/unit/resource/openssl_rsa_private_key.rb +++ /dev/null @@ -1,59 +0,0 @@ -# -# Copyright:: Copyright 2018, Chef Software, Inc. -# 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" - -describe Chef::Resource::OpensslRsaPrivateKey do - - let(:resource) { Chef::Resource::OpensslRsaPrivateKey.new("key") } - - it "has a resource name of :openssl_rsa_private_key" do - expect(resource.resource_name).to eql(:openssl_rsa_private_key) - end - - it "has a default action of create" do - expect(resource.action).to eql([:create]) - end - - it "has a default mode of '0600'" do - expect(resource.mode).to eql("0600") - end - - it "has a default key_cipher of 'des3'" do - expect(resource.key_cipher).to eql("des3") - end - - it "only accepts valid key_cipher values" do - expect { resource.key_cipher "fako" }.to raise_error(ArgumentError) - end - - it "has a default key_length of 2048" do - expect(resource.key_length).to eql(2048) - end - - it "only accepts valid key length" do - expect { resource.key_length 1234 }.to raise_error(ArgumentError) - end - - it "has a default force value of of false" do - expect(resource.force).to eql(false) - end - - it "the path property is the name property" do - expect(resource.path).to eql("key") - end -end diff --git a/spec/unit/resource/openssl_rsa_private_key_spec.rb b/spec/unit/resource/openssl_rsa_private_key_spec.rb new file mode 100644 index 0000000000..67bebf17fe --- /dev/null +++ b/spec/unit/resource/openssl_rsa_private_key_spec.rb @@ -0,0 +1,59 @@ +# +# Copyright:: Copyright 2018, Chef Software, Inc. +# 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" + +describe Chef::Resource::OpensslRsaPrivateKey do + + let(:resource) { Chef::Resource::OpensslRsaPrivateKey.new("key") } + + it "has a resource name of :openssl_rsa_private_key" do + expect(resource.resource_name).to eql(:openssl_rsa_private_key) + end + + it "has a default action of create" do + expect(resource.action).to eql([:create]) + end + + it "has a default mode of '0600'" do + expect(resource.mode).to eql("0600") + end + + it "has a default key_cipher of 'des3'" do + expect(resource.key_cipher).to eql("des3") + end + + it "only accepts valid key_cipher values" do + expect { resource.key_cipher "fako" }.to raise_error(ArgumentError) + end + + it "has a default key_length of 2048" do + expect(resource.key_length).to eql(2048) + end + + it "only accepts valid key length" do + expect { resource.key_length 1234 }.to raise_error(ArgumentError) + end + + it "has a default force value of of false" do + expect(resource.force).to eql(false) + end + + it "the path property is the name property" do + expect(resource.path).to eql("key") + end +end diff --git a/spec/unit/resource/openssl_rsa_public_key.rb b/spec/unit/resource/openssl_rsa_public_key.rb deleted file mode 100644 index d624e10338..0000000000 --- a/spec/unit/resource/openssl_rsa_public_key.rb +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright:: Copyright 2018, Chef Software, Inc. -# 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" - -describe Chef::Resource::OpensslRsaPublicKey do - - let(:resource) { Chef::Resource::OpensslRsaPublicKey.new("key") } - - it "has a resource name of :openssl_rsa_public_key" do - expect(resource.resource_name).to eql(:openssl_rsa_public_key) - end - - it "has a default action of create" do - expect(resource.action).to eql([:create]) - end - - it "has a default mode of '0640'" do - expect(resource.mode).to eql("0640") - end - - it "the path property is the name property" do - expect(resource.path).to eql("key") - end -end diff --git a/spec/unit/resource/openssl_rsa_public_key_spec.rb b/spec/unit/resource/openssl_rsa_public_key_spec.rb new file mode 100644 index 0000000000..d624e10338 --- /dev/null +++ b/spec/unit/resource/openssl_rsa_public_key_spec.rb @@ -0,0 +1,39 @@ +# +# Copyright:: Copyright 2018, Chef Software, Inc. +# 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" + +describe Chef::Resource::OpensslRsaPublicKey do + + let(:resource) { Chef::Resource::OpensslRsaPublicKey.new("key") } + + it "has a resource name of :openssl_rsa_public_key" do + expect(resource.resource_name).to eql(:openssl_rsa_public_key) + end + + it "has a default action of create" do + expect(resource.action).to eql([:create]) + end + + it "has a default mode of '0640'" do + expect(resource.mode).to eql("0640") + end + + it "the path property is the name property" do + expect(resource.path).to eql("key") + end +end -- cgit v1.2.1