3 Given /^un clone du Git contenant les adhésions$/ do
4 # Create main repository
7 @main_repository_path = current_dir
8 run_simple 'git init --quiet --bare'
12 run_simple 'git clone --quiet main clone'
15 BASE_SUBSCRIPTIONS.each_pair do |number, data|
16 file = subscription_filename_for_id(number)
17 write_file file, render_subscription_file(data)
18 run_simple "git add #{file}"
20 run_simple 'git commit --quiet -m "Initial data set from fixtures"'
21 run_simple 'git push --quiet origin master'
24 Given /^le « pre-commit hook » correctement configuré$/ do
25 FileUtils.ln_s File.expand_path('../../../bin/pre-commit-hook', __FILE__),
26 "#{current_dir}/.git/hooks/pre-commit"
29 Given /^le « pre-receive hook » configuré sur le dépôt principal$/ do
30 FileUtils.ln_s File.expand_path('../../../bin/pre-receive-hook', __FILE__),
31 "#{@main_repository_path}/hooks/pre-receive"
34 When /je fais un `commit` du nouveau fichier$/ do
35 run_simple "git add #{@file}"
36 run_simple "git commit #{@file} -m 'new file'", false # do not fail on error
39 When /^que je pousse la modification$/ do
40 run_simple "git add #{@file}"
41 run_simple "git commit #{@file} -m 'new file'"
42 run_simple 'git push origin master', false # do not fail on error