Skip to content

Instantly share code, notes, and snippets.

@mlafeldt
Created November 15, 2013 15:24
Show Gist options
  • Save mlafeldt/7486054 to your computer and use it in GitHub Desktop.
Save mlafeldt/7486054 to your computer and use it in GitHub Desktop.
Aruba shims
require "cucumber"
require "aruba/cucumber"
# Add shims to PATH
SHIMS = "#{Dir.pwd}/tmp/aruba/shims"
ENV['PATH'] = "#{SHIMS}:#{ENV['PATH']}"
def generate_shims_for(commands)
FileUtils.mkdir_p(SHIMS)
commands.each do |cmd|
File.open("#{SHIMS}/#{cmd}", "w", 0755) do |f|
f << "#!/bin/sh\n"
f << "echo \"#{cmd} $@\"\n"
end
end
end
Before do
generate_shims_for %w(berks rsync ssh vagrant)
end
Then(/^the command "([^"]*)" should be executed$/) do |cmd|
step %(the output should contain "#{cmd}")
end
Then(/^the command "([^"]*)" should not be executed$/) do |cmd|
step %(the output should not contain "#{cmd}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment