lib/beaker/dsl/helpers.rb in beaker-1.17.1 vs lib/beaker/dsl/helpers.rb in beaker-1.17.2

- old
+ new

@@ -76,19 +76,19 @@ # # @return [Result] An object representing the outcome of *command*. # @raise [FailTest] Raises an exception if *command* obviously fails. def on(host, command, opts = {}, &block) block_on host do | host | + cur_command = command if command.is_a? Command - command = command.cmd_line(host) + cur_command = command.cmd_line(host) end cmd_opts = {} #add any additional environment variables to the command if opts[:environment] cmd_opts['ENV'] = opts[:environment] end - command = Command.new(command.to_s, [], cmd_opts) - @result = host.exec(command, opts) + @result = host.exec(Command.new(cur_command.to_s, [], cmd_opts), opts) # Also, let additional checking be performed by the caller. if block_given? case block.arity #block with arity of 0, just hand back yourself