Class: Dockerspec::Runner::Docker
- Includes:
- Helper::MultipleSourcesDescription
- Defined in:
- lib/dockerspec/runner/docker.rb
Overview
This class runs a docker image (without using Serverspec for that).
This class is used mainly when you are not using Serverspec to run the tests.
Direct Known Subclasses
Constant Summary collapse
- OPTIONS_DEFAULT_KEY =
Returns The option key to set when you pass a string instead of a hash of options.
:tag
Instance Attribute Summary collapse
-
#container ⇒ Docker::Container
readonly
The internal Docker::Container object.
Attributes inherited from Base
Instance Method Summary collapse
-
#image_id ⇒ String
Gets the Docker image ID.
-
#initialize(*opts) ⇒ Dockerspec::Runner::Docker
constructor
Constructs a Docker runner class to run Docker images.
-
#to_s ⇒ String
Gets a descriptions of the object.
Methods included from Helper::MultipleSourcesDescription
Methods inherited from Base
#container_name, #finalize, #id, #ipaddress, #restore_rspec_context, #run
Methods included from ConfigHelpers
Constructor Details
#initialize(*opts) ⇒ Dockerspec::Runner::Docker
Constructs a Docker runner class to run Docker images.
91 92 93 94 |
# File 'lib/dockerspec/runner/docker.rb', line 91 def initialize(*opts) super send("setup_from_#{source}", [source]) end |
Instance Attribute Details
#container ⇒ Docker::Container (readonly)
The internal Docker::Container object.
51 52 53 |
# File 'lib/dockerspec/runner/docker.rb', line 51 def container @container end |
Instance Method Details
#image_id ⇒ String
Gets the Docker image ID.
108 109 110 111 |
# File 'lib/dockerspec/runner/docker.rb', line 108 def image_id return @build.id unless @build.nil? super end |
#to_s ⇒ String
Gets a descriptions of the object.
128 129 130 |
# File 'lib/dockerspec/runner/docker.rb', line 128 def to_s description('Docker Run from') end |