templates/parent/spec/spec_helper.erb in opskeleton-0.8.9 vs templates/parent/spec/spec_helper.erb in opskeleton-0.8.10
- old
+ new
@@ -1,12 +1,12 @@
require 'serverspec'
require 'pathname'
require 'net/ssh'
-include SpecInfra::Helper::Ssh
-include SpecInfra::Helper::DetectOS
+set :backend, :ssh
+
def run(cmd)
unless(system(cmd, out: $stdout, err: :out))
puts 'Failed to setup vagrant machine'
exit 1
end
@@ -43,22 +43,23 @@
if config != ''
config.each_line do |line|
if match = /HostName (.*)/.match(line)
sshhost = match[1]
elsif match = /User (.*)/.match(line)
- sshuser = match[1]
+ options[:user] = match[1]
elsif match = /IdentityFile (.*)/.match(line)
options[:keys] = [match[1].gsub(/"/,'')]
elsif match = /Port (.*)/.match(line)
options[:port] = match[1]
end
end
end
else
sshhost = 'localhost'
- sshuser = 'vagrant'
+ options[:user] = 'vagrant'
end
- c.ssh = Net::SSH.start(sshhost, sshuser, options)
+ set :host, sshhost
+ set :ssh_options,options
end
c.after :suite do
c.host = ENV['TARGET_HOST']
<% if(options[:bench_enable]) %>