Sha256: 1a7dfb5a1892d0a27cbb62542242cece8bd56cea798585509d128d94261334fa

Contents?: true

Size: 850 Bytes

Versions: 2

Compression:

Stored size: 850 Bytes

Contents

module TFA
  describe ShowCommand do
    subject { ShowCommand.new(storage) }
    let(:storage) { Storage.new(SecureRandom.uuid) }

    describe "#run" do
      context "when looking up the secret for a specific key" do
        it "retrieves the secret associated with the key given" do
          secret = SecureRandom.uuid
          storage.save('production', secret)
          result = subject.run(['production'])
          expect(result).to eql(secret)
        end
      end

      context "when a specific name is not given" do
        it "returns all the secrets" do
          storage.save('development', "1")
          storage.save('staging', "2")
          storage.save('production', "3")
          expect(subject.run([])).to eql([{"development" => "1"}, { "staging" => "2" }, { "production" => "3" }])
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tfa-0.0.6 spec/lib/show_command_spec.rb
tfa-0.0.5 spec/lib/show_command_spec.rb