class Chef::Resource::User

Public Instance Methods

to_serverspec() click to toggle source
# File lib/chef/handler/resources/user.rb, line 4
      def to_serverspec
        ERB.new(
          <<-EOT,

  describe user('#{username}') do
<%- unless action.include? :remove -%>
    it { should exist }
    <%- if uid -%>
    it { should have_uid #{uid} }
    <%- end -%>
    <%- if shell -%>
    it { should have_login_shell '#{shell}' }
    <%- end -%>
    <%- if home -%>
    it { should have_home_directory '#{home}' }
    <%- end -%>
<%- else -%>
      it { should_not exist }
<%- end -%>
  end
EOT
          safe_level = nil, trim_mode = '-').result(binding)
      end