From e251ba968c8fb3802060370a0a86ad3bd139dc0d Mon Sep 17 00:00:00 2001 From: Sachin Date: Wed, 30 Oct 2024 11:43:47 +0530 Subject: [PATCH] add test case Signed-off-by: Sachin --- .../policyfile/artifactory_cookbook_source_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/unit/policyfile/artifactory_cookbook_source_spec.rb b/spec/unit/policyfile/artifactory_cookbook_source_spec.rb index 795fab27..1f48fd96 100644 --- a/spec/unit/policyfile/artifactory_cookbook_source_spec.rb +++ b/spec/unit/policyfile/artifactory_cookbook_source_spec.rb @@ -83,7 +83,7 @@ end end - describe "#ARTIFACTORY_IDENTITY_KEY" do + describe "#artifactory_identity_key" do before do ENV["ARTIFACTORY_IDENTITY_KEY"] = "test" end @@ -91,19 +91,19 @@ context "when config is not present" do let(:config) { nil } it "should get artifactory key from the env" do - expect(subject.ARTIFACTORY_IDENTITY_KEY).to eq("test") + expect(subject.artifactory_identity_key).to eq("test") end end context "when config is present" do let(:config) { double("Chef::Config") } it "should get artifactory key from config when key is present" do - expect(config).to receive(:ARTIFACTORY_IDENTITY_KEY).and_return "test1" - expect(subject.ARTIFACTORY_IDENTITY_KEY).to eq("test1") + expect(config).to receive(:artifactory_identity_key).and_return "test1" + expect(subject.artifactory_identity_key).to eq("test1") end it "should get artifactory key from env when config is present but has a nil key" do - expect(config).to receive(:ARTIFACTORY_IDENTITY_KEY).and_return nil - expect(subject.ARTIFACTORY_IDENTITY_KEY).to eq("test") + expect(config).to receive(:artifactory_identity_key).and_return nil + expect(subject.artifactory_identity_key).to eq("test") end end end