]> nos-oignons.net Git - gestion-adh.git/blobdiff - features/step_definitions/git.rb
Implement first scenario
[gestion-adh.git] / features / step_definitions / git.rb
diff --git a/features/step_definitions/git.rb b/features/step_definitions/git.rb
new file mode 100644 (file)
index 0000000..30d6e7c
--- /dev/null
@@ -0,0 +1,25 @@
+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