Sha256: 1f83cc10b1f19cdc0b2e18cd68b824f8e345c5b50e7d8290cc464a2bf03fbc13

Contents?: true

Size: 858 Bytes

Versions: 1

Compression:

Stored size: 858 Bytes

Contents

module TFA
  describe ShowCommand do
    subject { ShowCommand.new(storage) }
    let(:storage) { Storage.new(Tempfile.new('blah').path) }

    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

1 entries across 1 versions & 1 rubygems

Version Path
tfa-0.0.4 spec/lib/show_command_spec.rb