Created
November 15, 2013 15:24
-
-
Save mlafeldt/7486054 to your computer and use it in GitHub Desktop.
Aruba shims
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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