# File lib/serverspec/setup.rb, line 253
    def self.spec_helper_template
      template = "require 'serverspec'\n<% if @backend_type == 'ssh' -%>\nrequire 'net/ssh'\n<% end -%>\n<%- if @vagrant -%>\nrequire 'tempfile'\n<% end -%>\n<% if @backend_type == 'winrm' -%>\nrequire 'winrm'\n<% end -%>\n\nset :backend, :<%= @backend_type %>\n\n<% if @os_type == 'UN*X' && @backend_type == 'ssh' -%>\nif ENV['ASK_SUDO_PASSWORD']\nbegin\nrequire 'highline/import'\nrescue LoadError\nfail \"highline is not available. Try installing it.\"\nend\nset :sudo_password, ask(\"Enter sudo password: \") { |q| q.echo = false }\nelse\nset :sudo_password, ENV['SUDO_PASSWORD']\nend\n\n<%- if @backend_type == 'ssh' -%>\nhost = ENV['TARGET_HOST']\n\n<%- if @vagrant -%>\n`vagrant up \#{host}`\n\nconfig = Tempfile.new('', Dir.tmpdir)\nconfig.write(`vagrant ssh-config \#{host}`)\nconfig.close\n\noptions = Net::SSH::Config.for(host, [config.path])\n<%- else -%>\noptions = Net::SSH::Config.for(host)\n<%- end -%>\n\noptions[:user] ||= Etc.getlogin\n\nset :host,        options[:host_name] || host\nset :ssh_options, options\n\n# Disable sudo\n# set :disable_sudo, true\n<%- end -%>\n\n\n# Set environment variables\n# set :env, :LANG => 'C', :LC_MESSAGES => 'C'\n\n# Set PATH\n# set :path, '/sbin:/usr/local/sbin:$PATH'\n<%- end -%>\n<% if @backend_type == 'winrm'-%>\nuser = <username>\npass = <password>\nendpoint = \"http://\#{ENV['TARGET_HOST']}:5985/wsman\"\n\nwinrm = ::WinRM::WinRMWebService.new(endpoint, :ssl, :user => user, :pass => pass, :basic_auth_only => true)\nwinrm.set_timeout 300 # 5 minutes max timeout for any operation\nSpecinfra.configuration.winrm = winrm\n<% end -%>\n"
      template
    end