Sha256: 429eada7c68bdc9af22e8e7d4587e6062765105e16bb13f8e949683c6b7fb701

Contents?: true

Size: 857 Bytes

Versions: 13

Compression:

Stored size: 857 Bytes

Contents

require 'conjur/authn'
require 'conjur/config'

describe Conjur::Authn do
  describe "netrc" do
    before {
      Conjur::Authn.instance_variable_set("@netrc", nil)
      Conjur::Config.should_receive(:[]).with(:netrc_path).and_return path
    }
    after {
      Conjur::Authn.instance_variable_set("@netrc", nil)
    }
    context "with specified netrc_path" do
      let(:path) { double("path") }
      it "consults Conjur::Config for netrc_path" do
        Netrc.should_receive(:read).with(path).and_return netrc = double("netrc")
        Conjur::Authn.netrc.should == netrc
      end
    end
    context "without specified netrc_path" do
      let(:path) { nil }
      it "uses default netrc path" do
        Netrc.should_receive(:read).with().and_return netrc = double("netrc")
        Conjur::Authn.netrc.should == netrc
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
conjur-cli-4.10.3 spec/authn_spec.rb
conjur-cli-4.10.1 spec/authn_spec.rb
conjur-cli-4.9.3 spec/authn_spec.rb
conjur-cli-4.8.0 spec/authn_spec.rb
conjur-cli-4.7.5 spec/authn_spec.rb
conjur-cli-4.7.4 spec/authn_spec.rb
conjur-cli-4.7.3 spec/authn_spec.rb
conjur-cli-4.7.2 spec/authn_spec.rb
conjur-cli-4.7.1 spec/authn_spec.rb
conjur-cli-4.7.0 spec/authn_spec.rb
conjur-cli-4.6.1 spec/authn_spec.rb
conjur-cli-4.5.1 spec/authn_spec.rb
conjur-cli-4.5.0 spec/authn_spec.rb