require 'fileutils'

Given /^un clone du Git contenant les adhésions$/ do
  # Create main repository
  create_dir 'main'
  cd 'main'
  run_simple 'git init'
  create_dir 'Membres'
  BASE_SUBSCRIPTIONS.each_pair do |number, data|
    file = subscription_filename_for_id(number)
    write_file file, render_subscription_file(data)
    run_simple "git add #{file}"
  end
  run_simple 'git commit -m "Initial data set from fixtures"'
  cd '..'

  # Clone it now
  run_simple 'git clone main clone'
  cd 'clone'
end

When /je fait un `commit` du nouveau fichier$/ do
  run_simple "git add #{@file}"
  run_simple "git commit #{@file} -m 'new file'"
end
