class Inspec::Resources::IisSite

def app_pool

def app_pool
  iis_site.nil? ? nil : iis_site[:app_pool]
end

def bindings

def bindings
  iis_site.nil? ? nil : iis_site[:bindings]
end

def exists?

def exists?
  !iis_site.nil? && !iis_site[:name].nil?
end

def has_app_pool?(app_pool)

def has_app_pool?(app_pool)
  iis_site.nil? ? false : iis_site[:app_pool] == app_pool
end

def has_binding?(binding)

def has_binding?(binding)
  iis_site.nil? ? false : (iis_site[:bindings].include? binding)
end

def has_path?(path)

def has_path?(path)
  iis_site.nil? ? false : iis_site[:path] == path
end

def iis_site

def iis_site
  return @cache if !@cache.nil?
  @cache = @site_provider.iis_site(@site_name) if !@site_provider.nil?
end

def initialize(site_name)

def initialize(site_name)
  @site_name = site_name
  @cache = nil
  @site_provider = SiteProvider.new(inspec)
  # verify that this resource is only supported on Windows
  return skip_resource 'The `iis_site` resource is not supported on your OS.' if inspec.os[:family] != 'windows'
end

def path

def path
  iis_site.nil? ? nil : iis_site[:path]
end

def running?

def running?
  iis_site.nil? ? false : (iis_site[:state] == 'Started')
end

def state

def state
  iis_site.nil? ? nil : iis_site[:state]
end

def to_s

def to_s
  "iis_site '#{@site_name}'"
end