Sha256: 074d677ce792362bd769f8cad5cf8f415ebae9d145cce269f5ff9fa52cca00e6

Contents?: true

Size: 1.22 KB

Versions: 78

Compression:

Stored size: 1.22 KB

Contents

#! /usr/bin/env ruby
require 'spec_helper'
require 'puppet/network/authorization'

describe Puppet::Network::Authorization do
  class AuthTest
    include Puppet::Network::Authorization
  end

  subject { AuthTest.new }

  describe "when creating an authconfig object" do
    before :each do
      # Other tests may have created an authconfig, so we have to undo that.
      @orig_auth_config = Puppet::Network::AuthConfigLoader.instance_variable_get(:@auth_config)
      @orig_auth_config_file = Puppet::Network::AuthConfigLoader.instance_variable_get(:@auth_config_file)

      Puppet::Network::AuthConfigLoader.instance_variable_set(:@auth_config, nil)
      Puppet::Network::AuthConfigLoader.instance_variable_set(:@auth_config_file, nil)
    end

    after :each do
      Puppet::Network::AuthConfigLoader.instance_variable_set(:@auth_config, @orig_auth_config)
      Puppet::Network::AuthConfigLoader.instance_variable_set(:@auth_config_file, @orig_auth_config_file)
    end

    it "creates default ACL entries if no file has been read" do
      Puppet::Network::AuthConfigParser.expects(:new_from_file).raises Errno::ENOENT
      Puppet::Network::AuthConfig.any_instance.expects(:insert_default_acl)

      subject.authconfig
    end
  end
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
puppet-3.7.5-x86-mingw32 spec/unit/network/authorization_spec.rb
puppet-3.7.5-x64-mingw32 spec/unit/network/authorization_spec.rb
puppet-4.0.0.rc1 spec/unit/network/authorization_spec.rb
puppet-4.0.0.rc1-x86-mingw32 spec/unit/network/authorization_spec.rb
puppet-4.0.0.rc1-x64-mingw32 spec/unit/network/authorization_spec.rb
puppet-3.7.4 spec/unit/network/authorization_spec.rb
puppet-3.7.4-x86-mingw32 spec/unit/network/authorization_spec.rb
puppet-3.7.4-x64-mingw32 spec/unit/network/authorization_spec.rb
puppet-3.7.3 spec/unit/network/authorization_spec.rb
puppet-3.7.3-x86-mingw32 spec/unit/network/authorization_spec.rb
puppet-3.7.3-x64-mingw32 spec/unit/network/authorization_spec.rb
puppet-3.7.2 spec/unit/network/authorization_spec.rb
puppet-3.7.2-x86-mingw32 spec/unit/network/authorization_spec.rb
puppet-3.7.2-x64-mingw32 spec/unit/network/authorization_spec.rb
puppet-3.7.1 spec/unit/network/authorization_spec.rb
puppet-3.7.1-x86-mingw32 spec/unit/network/authorization_spec.rb
puppet-3.7.1-x64-mingw32 spec/unit/network/authorization_spec.rb
puppet-3.7.0 spec/unit/network/authorization_spec.rb
puppet-3.7.0-x86-mingw32 spec/unit/network/authorization_spec.rb
puppet-3.7.0-x64-mingw32 spec/unit/network/authorization_spec.rb