features/step_definitions/steps.rb in vagrant-exec-0.2.1 vs features/step_definitions/steps.rb in vagrant-exec-0.3.0

- old
+ new

@@ -1,49 +1,8 @@ -Given(/^I have default Vagrantfile$/) do - vagrantfile = <<-RUBY -Vagrant.require_plugin 'vagrant-exec' - -Vagrant.configure('2') do |config| - config.vm.box = 'vagrant_exec' -end - RUBY - step 'a file named "Vagrantfile" with:', vagrantfile -end - - -Given(/^I set vagrant-exec folder to (.+)$/) do |folder| - config = <<-RUBY - -Vagrant.configure('2') do |config| - config.exec.folder = #{folder} -end - RUBY - step 'I append to "Vagrantfile" with:', config -end - - -Given(/^I set vagrant-exec bundler to (.+)$/) do |bundler| - config = <<-RUBY - -Vagrant.configure('2') do |config| - config.exec.bundler = #{bundler} -end - RUBY - step 'I append to "Vagrantfile" with:', config -end - - -Given(/^I set vagrant-exec env with the following values:$/) do |table| - data = table.hashes - config = data.map do |hash| - key, value = "#{hash['key']}", "#{hash['value']}" - %(config.exec.env['#{key}'] = '#{value}') - end - - config = <<-RUBY - -Vagrant.configure('2') do |config| - #{config.join("\n\s\s")} -end - RUBY - step 'I append to "Vagrantfile" with:', config +Then(/^SHH subprocess should execute command "(.+)"$/) do |command| + ssh = %w(vagrant@127.0.0.1 -p 2200 -o Compression=yes) + ssh += %w(-o DSAAuthentication=yes -o LogLevel=FATAL) + ssh += %w(-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null) + ssh += %W(-o IdentitiesOnly=yes -i #{Dir.home}/.vagrant.d/insecure_private_key) + ssh += ['-q', '-t', "bash -l -c '#{command.delete('"')} --'"] + assert_partial_output("Executing SSH in subprocess: #{ssh}", all_output) end