Module: Dockerspec::Runner::Serverspec::Base

Included in:
Compose, Docker
Defined in:
lib/dockerspec/runner/serverspec/base.rb

Overview

Base class to be included by Serverspec runners.

Examples:

module Dockerspec
  module Runner
    module Serverspec
      class MyRunner
        include Base
      end
    end
  end
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#backend_nameSymbol (readonly)

The Specinfra backend name to use.

Returns:

  • (Symbol)

    The backend name.



57
58
59
# File 'lib/dockerspec/runner/serverspec/base.rb', line 57

def backend_name
  @backend_name
end

Instance Method Details

#finalizeObject

Stops and deletes the Docker Container.

Actually does nothing. Do no delete anything, lets Specinfra do that.

Returns:

  • void



68
69
70
# File 'lib/dockerspec/runner/serverspec/base.rb', line 68

def finalize
  # Do not stop the container
end

#to_sString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Generates a description of the object.

Examples:

Running Against a Container Image Tag

self.description #=> "Serverspec on tag: \"debian\""

Running Against a Running Container ID

self.description #=> "Serverspec on id: \"92cc98ab560a\""

Returns:

  • (String)

    The object description.



85
86
87
# File 'lib/dockerspec/runner/serverspec/base.rb', line 85

def to_s
  description('Serverspec on')
end