class Serverspec::Type::OctopusDeployTeam

Public Class Methods

new(*url_and_api_key, team_name) click to toggle source
# File lib/octopus_serverspec_extensions/type/octopus_deploy_team.rb, line 14
def initialize(*url_and_api_key, team_name)
  serverUrl,apiKey = get_octopus_creds(url_and_api_key)

  @team_name = team_name

  @name = "Octopus Deploy User Account #{serverUrl}"
  @runner = Specinfra::Runner
  @serverUrl = serverUrl
  @apiKey = apiKey

  if team_name.nil?
    raise "'team_name' was not provided"
  end
end

Public Instance Methods

exists?() click to toggle source
# File lib/octopus_serverspec_extensions/type/octopus_deploy_team.rb, line 29
def exists?
  load_resource_if_nil
  @team != nil?
end
in_space(space_name) click to toggle source
# File lib/octopus_serverspec_extensions/type/octopus_deploy_team.rb, line 34
def in_space(space_name)
  # allows us to tag .in_space() onto the end of the resource. as in
  # describe octopus_account("account name").in_space("MyNewSpace") do
  @spaceId = get_space_id?(space_name)
  if @team_name.nil?
    raise "'team_name' was not provided. Unable to connect to Octopus server to validate configuration."
  end
  self
end
load_resource_if_nil() click to toggle source
# File lib/octopus_serverspec_extensions/type/octopus_deploy_team.rb, line 44
def load_resource_if_nil
  if @team.nil?
    @team = get_team_via_api(@serverUrl, @apiKey, @team_name)
  end
end