Class: Serverspec::Type::OctopusDeploySpace
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::OctopusDeploySpace
- Defined in:
- lib/octopus_serverspec_extensions/type/octopus_deploy_space.rb
Instance Method Summary collapse
- #default? ⇒ Boolean
- #exists? ⇒ Boolean
- #has_description?(description) ⇒ Boolean
- #has_running_task_queue? ⇒ Boolean
-
#initialize(*url_and_api_key, space_name) ⇒ OctopusDeploySpace
constructor
A new instance of OctopusDeploySpace.
- #load_resource_if_nil ⇒ Object
Constructor Details
#initialize(*url_and_api_key, space_name) ⇒ OctopusDeploySpace
Returns a new instance of OctopusDeploySpace.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_space.rb', line 12 def initialize(*url_and_api_key, space_name) serverUrl, apiKey = get_octopus_creds(url_and_api_key) @name = "Octopus Deploy Space #{space_name}" @runner = Specinfra::Runner @serverUrl = serverUrl @apiKey = apiKey if space_name.nil? raise "'space_name' was not included. Cannot contact server to validate space." end @spaceName = space_name end |
Instance Method Details
#default? ⇒ Boolean
32 33 34 35 36 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_space.rb', line 32 def default? load_resource_if_nil false if @space.nil? @space['IsDefault'] == true end |
#exists? ⇒ Boolean
27 28 29 30 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_space.rb', line 27 def exists? load_resource_if_nil @space.nil? == false end |
#has_description?(description) ⇒ Boolean
44 45 46 47 48 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_space.rb', line 44 def has_description?(description) load_resource_if_nil false if @space.nil? @space['Description'] == description end |
#has_running_task_queue? ⇒ Boolean
38 39 40 41 42 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_space.rb', line 38 def has_running_task_queue? load_resource_if_nil false if @space.nil? @space['TaskQueueStopped'] == false end |
#load_resource_if_nil ⇒ Object
50 51 52 53 54 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_space.rb', line 50 def load_resource_if_nil if @space.nil? @space = get_space_via_api end end |