spec/support/test_app.rb in capistrano-3.7.2 vs spec/support/test_app.rb in capistrano-3.8.0
- old
+ new
@@ -17,10 +17,11 @@
set :ssh_options, { keys: "\#{ENV['HOME']}/.vagrant.d/insecure_private_key", auth_methods: ['publickey'] }
server 'vagrant@localhost:2220', roles: %w{web app}
set :linked_files, #{linked_files}
set :linked_dirs, #{linked_dirs}
set :format_options, log_file: nil
+ set :local_user, #{current_user.inspect}
CONFIG
end
def linked_files
%w{config/database.yml}
@@ -87,17 +88,18 @@
def create_shared_file(path)
File.open(shared_path.join(path), "w")
end
- def cap(task)
- run "bundle exec cap #{stage} #{task}"
+ def cap(task, subdirectory=nil)
+ run "bundle exec cap #{stage} #{task}", subdirectory
end
- def run(command)
+ def run(command, subdirectory=nil)
output = nil
- Dir.chdir(test_app_path) do
+ dir = subdirectory ? test_app_path.join(subdirectory) : test_app_path
+ Dir.chdir(dir) do
output = `#{command}`
end
[$CHILD_STATUS.success?, output]
end
@@ -152,10 +154,10 @@
def capfile
test_app_path.join("Capfile")
end
def current_user
- `whoami`.chomp
+ "(GitHub Web Flow) via ShipIt"
end
def task_dir
test_app_path.join("lib/capistrano/tasks")
end