lib/conjur/command/rspec/mock_services.rb in conjur-cli-4.26.0 vs lib/conjur/command/rspec/mock_services.rb in conjur-cli-4.27.0

- old
+ new

@@ -14,21 +14,21 @@ shared_context "with mock authn" do include_context "with fake endpoints and test config" let(:netrcfile) { Tempfile.new 'authtest' } let(:netrc) { Netrc.read(netrcfile.path) } let(:account) { 'the-account' } + let(:username) { 'dknuth' } + let(:api_key) { 'sekrit' } + let(:api) { Conjur::API.new_from_key(username, api_key) } before do allow(Conjur::Core::API).to receive(:conjur_account) { account } allow(Conjur::Authn).to receive_messages(netrc: netrc, host: authn_host) Conjur::Config.merge 'account' => account end end shared_context "when logged in", logged_in: true do include_context "with mock authn" - let(:username) { 'dknuth' } - let(:api_key) { 'sekrit' } - let(:api) { Conjur::API.new_from_key(username, api_key) } before do allow(api).to receive(:credentials) { {} } netrc[authn_host] = [username, api_key] allow(Conjur::Command).to receive_messages api: api end