Sha256: b2cbe0e1eeb3f3f281d41315629ebbd8bfb8e65116b6d27a442de6036e5b7d79
Contents?: true
Size: 1.26 KB
Versions: 56
Compression:
Stored size: 1.26 KB
Contents
require 'kontena/cli/vault/export_command' describe Kontena::Cli::Vault::ExportCommand do include RequirementsHelper let(:subject) do described_class.new(File.basename($0)) end expect_to_require_current_master before(:each) do allow(Kontena::Cli::Config.instance).to receive(:current_master).and_return(Kontena::Cli::Config::Server.new) end it 'goes through the list of vault keys and outputs a yaml' do expect(Kontena).to receive(:run!).with(['vault', 'ls', '--return']).and_return(['foo', 'bar']) expect(Kontena).to receive(:run!).with(['vault', 'read', '--return', 'bar']).and_return('barbar') expect(Kontena).to receive(:run!).with(['vault', 'read', '--return', 'foo']).and_return('foofoo') expect{subject.run([])}.to output(/bar: barbar\nfoo: foofoo/).to_stdout end it 'goes through the list of vault keys and outputs a json' do expect(Kontena).to receive(:run!).with(['vault', 'ls', '--return']).and_return(['foo', 'bar']) expect(Kontena).to receive(:run!).with(['vault', 'read', '--return', 'bar']).and_return('barbar') expect(Kontena).to receive(:run!).with(['vault', 'read', '--return', 'foo']).and_return('foofoo') expect{subject.run(['--json'])}.to output(/\"bar\":\"barbar\",\"foo\":\"foofoo\"/).to_stdout end end
Version data entries
56 entries across 56 versions & 1 rubygems