5 Given /^un clone du Git contenant les adhésions$/ do
6 # Create main repository
9 @main_repository_path = current_dir
10 run_simple 'git init --quiet --bare'
14 run_simple 'git clone --quiet main clone'
17 BASE_MEMBERS.each_pair do |number, data|
18 file = member_filename_for_id(number)
19 write_file file, render_member_file(data)
20 run_simple "git add #{file}"
22 run_simple 'git commit --quiet -m "Initial data set from fixtures"'
23 run_simple 'git push --quiet origin master'
26 Given /^le « pre-commit hook » correctement configuré$/ do
27 FileUtils.ln_s File.expand_path('../../../bin/pre-commit-hook', __FILE__),
28 "#{current_dir}/.git/hooks/pre-commit"
31 Given /^le « pre-receive hook » configuré sur le dépôt principal$/ do
32 FileUtils.ln_s File.expand_path('../../../bin/pre-receive-hook', __FILE__),
33 "#{@main_repository_path}/hooks/pre-receive"
36 When /je fais un `commit` du nouveau fichier$/ do
37 run_simple "git add #{@file}"
38 run_simple "git commit #{@file} -m 'new file'", false # do not fail on error
41 When /^que je pousse la modification$/ do
42 run_simple "git add #{@file}"
43 run_simple "git commit #{@file} -m 'new file'"
44 run_simple 'git push origin master', false # do not fail on error