Skip to content

Instantly share code, notes, and snippets.

@raphink
Created April 2, 2013 12:13
Show Gist options
  • Select an option

  • Save raphink/5291766 to your computer and use it in GitHub Desktop.

Select an option

Save raphink/5291766 to your computer and use it in GitHub Desktop.
require 'serverspec'
require 'pathname'
require 'open3'
module ExecHelper
def ssh_exec(cmd, opts={})
stdin, stdout, stderr = Open3.popen3(cmd)
{ :stdout => stdout.gets, :stderr => stderr.gets, :exit_code => $?.to_i, :exit_signal => nil }
end
end
RSpec.configure do |c|
c.include(Serverspec::DebianHelper)
c.include(ExecHelper)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment