Class: SpecInfra::Backend::BeakerExec
- Inherits:
-
Exec
- Object
- Exec
- SpecInfra::Backend::BeakerExec
- Defined in:
- lib/beaker-rspec/helpers/serverspec.rb
Overview
Class BeakerExec
Controls the running of Serverspec commands.
Instance Method Summary collapse
-
#run_command(cmd, opt = {}) ⇒ Hash
Run a command using serverspec.
Instance Method Details
#run_command(cmd, opt = {}) ⇒ Hash
Run a command using serverspec. Defaults to running on the ‘default’ test node, otherwise uses the node specified in @example.metadata
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/beaker-rspec/helpers/serverspec.rb', line 19 def run_command(cmd, opt={}) cmd = build_command(cmd) cmd = add_pre_command(cmd) ret = ssh_exec!(cmd) if @example @example.[:command] = cmd @example.[:stdout] = ret[:stdout] end CommandResult.new ret end |