Sha256: c092805b1c39d096248c532863900fa689f037b12914d655f45aae63c427c839

Contents?: true

Size: 1.19 KB

Versions: 17

Compression:

Stored size: 1.19 KB

Contents

shared_context "with fake endpoints and test config" do
  let(:authn_host) { 'https://authn.example.com' }
  let(:authz_host) { 'https://authz.example.com' }
  let(:core_host) { 'https://core.example.com' }
  before do
    Conjur::Authn::API.stub host: authn_host
    Conjur::Authz::API.stub host: authz_host
    Conjur::Core::API.stub host: core_host

    ENV['GLI_DEBUG'] = 'true'
  end
end

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' }
  before do
    Conjur::Core::API.stub conjur_account: account
    Conjur::Authn.stub 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
    api.stub credentials: {}
    netrc[authn_host] = [username, api_key]
    Conjur::Command.stub api: api
  end
end

shared_context "when not logged in", logged_in: false do
  include_context "with mock authn"
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
conjur-cli-4.14.0 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.13.1 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.12.0 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.10.3 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.10.1 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.9.3 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.8.0 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.7.5 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.7.4 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.7.3 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.7.2 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.7.1 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.7.0 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.6.1 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.5.1 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.5.0 lib/conjur/command/rspec/mock_services.rb
conjur-cli-4.4.0 lib/conjur/command/rspec/mock_services.rb