Sha256: bb0a1758c4a3d34e2de578a9ee0bb848c237837dd07c1b94719bbeaa44d9746f

Contents?: true

Size: 1.04 KB

Versions: 40

Compression:

Stored size: 1.04 KB

Contents

module Serverspec::Type
  class User < Base
    def exists?
      @runner.check_user_exists(@name)
    end

    def belongs_to_group?(group)
      @runner.check_user_belongs_to_group(@name, group)
    end

    def belongs_to_primary_group?(group)
      @runner.check_user_belongs_to_primary_group(@name, group)
    end

    def has_uid?(uid)
      @runner.check_user_has_uid(@name, uid)
    end

    def has_home_directory?(path)
      @runner.check_user_has_home_directory(@name, path)
    end

    def has_login_shell?(shell)
      @runner.check_user_has_login_shell(@name, shell)
    end

    def has_authorized_key?(key)
      @runner.check_user_has_authorized_key(@name, key)
    end

    def minimum_days_between_password_change
      @runner.get_user_minimum_days_between_password_change(@name).stdout.to_i
    end

    def maximum_days_between_password_change
      @runner.get_user_maximum_days_between_password_change(@name).stdout.to_i
    end

    def encrypted_password
      @runner.get_user_encrypted_password(@name).stdout.strip
    end 
  end
end

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
serverspec-2.41.8 lib/serverspec/type/user.rb
serverspec-2.41.7 lib/serverspec/type/user.rb
serverspec-2.41.6 lib/serverspec/type/user.rb
serverspec-2.41.5 lib/serverspec/type/user.rb
serverspec-2.41.4 lib/serverspec/type/user.rb
serverspec-ruby19-2.24.3 lib/serverspec/type/user.rb
serverspec-2.41.3 lib/serverspec/type/user.rb
serverspec-2.41.2 lib/serverspec/type/user.rb
serverspec-2.41.1 lib/serverspec/type/user.rb
serverspec-2.41.0 lib/serverspec/type/user.rb
serverspec-2.40.0 lib/serverspec/type/user.rb
serverspec-2.39.2 lib/serverspec/type/user.rb
serverspec-2.39.1 lib/serverspec/type/user.rb
serverspec-2.39.0 lib/serverspec/type/user.rb
serverspec-2.38.1 lib/serverspec/type/user.rb
serverspec-2.38.0 lib/serverspec/type/user.rb
serverspec-2.37.2 lib/serverspec/type/user.rb
serverspec-2.37.1 lib/serverspec/type/user.rb
serverspec-2.37.0 lib/serverspec/type/user.rb
serverspec-2.36.1 lib/serverspec/type/user.rb