2013-09-27 11:45:55 +01:00
|
|
|
Given(/^a test app with the default configuration$/) do
|
|
|
|
TestApp.install
|
|
|
|
end
|
|
|
|
|
|
|
|
Given(/^servers with the roles app and web$/) do
|
2014-01-18 23:18:55 +02:00
|
|
|
vagrant_cli_command('up') rescue nil
|
2013-09-27 11:45:55 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
Given(/^a required file$/) do
|
|
|
|
end
|
|
|
|
|
|
|
|
Given(/^that file exists$/) do
|
|
|
|
run_vagrant_command("touch #{TestApp.linked_file}")
|
|
|
|
end
|
|
|
|
|
|
|
|
Given(/^the file does not exist$/) do
|
|
|
|
pending
|
|
|
|
file = TestApp.linked_file
|
|
|
|
run_vagrant_command("[ -f #{file} ] && rm #{file}")
|
|
|
|
end
|
|
|
|
|
|
|
|
Given(/^a custom task to generate a file$/) do
|
2014-01-23 11:07:13 +04:00
|
|
|
TestApp.copy_task_to_test_app('spec/support/tasks/database.rake')
|
2013-09-27 11:45:55 +01:00
|
|
|
end
|
|
|
|
|
2014-01-18 23:18:55 +02:00
|
|
|
Given(/config stage file has line "(.*?)"/) do |line|
|
|
|
|
TestApp.append_to_deploy_file(line)
|
|
|
|
end
|
|
|
|
|
2013-10-11 17:24:37 +01:00
|
|
|
Given(/^the configuration is in a custom location$/) do
|
|
|
|
TestApp.move_configuration_to_custom_location('app')
|
|
|
|
end
|
2013-11-01 11:59:13 +00:00
|
|
|
|
|
|
|
Given(/^a custom task that will simulate a failure$/) do
|
|
|
|
safely_remove_file(TestApp.shared_path.join('failed'))
|
2014-01-23 11:07:13 +04:00
|
|
|
TestApp.copy_task_to_test_app('spec/support/tasks/fail.rake')
|
2013-11-01 11:59:13 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Given(/^a custom task to run in the event of a failure$/) do
|
|
|
|
safely_remove_file(TestApp.shared_path.join('failed'))
|
2014-01-23 11:07:13 +04:00
|
|
|
TestApp.copy_task_to_test_app('spec/support/tasks/failed.rake')
|
2013-11-01 11:59:13 +00:00
|
|
|
end
|