Module: Dockerspec::Runner::ConfigHelpers
- Included in:
- Dockerspec::RSpec::Resources::ItsContainer, Base
- Defined in:
- lib/dockerspec/runner/config_helpers.rb
Overview
Some helpers to get information from a running container.
Instance Method Summary collapse
-
#parse_log(log) ⇒ String
private
Parse the stdout/stderr log binary stream.
-
#stderr ⇒ String
Returns the container stderr logs.
-
#stdout ⇒ String
Returns the container stdout logs.
Instance Method Details
#parse_log(log) ⇒ String
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.
Parse the stdout/stderr log binary stream.
38 39 40 |
# File 'lib/dockerspec/runner/config_helpers.rb', line 38 def parse_log(log) log.sub(/^.*?\a/, '') end |
#stderr ⇒ String
Returns the container stderr logs.
91 92 93 94 |
# File 'lib/dockerspec/runner/config_helpers.rb', line 91 def stderr log = container.logs(stderr: true).to_s parse_log(log) end |
#stdout ⇒ String
Returns the container stdout logs.
64 65 66 67 |
# File 'lib/dockerspec/runner/config_helpers.rb', line 64 def stdout log = container.logs(stdout: true) parse_log(log) end |