+#-*- coding: utf-8 -*-
+
+When /^j'exécute list\-emails$/ do
+ run_simple 'list-emails'
+end
+
+When /^j'exécute list-emails le (\d+)\-(\d+)\-(\d+)$/ do |year, month, day|$/
+ Timecop.travel(Time.new(year, month, day)) do
+ stdout_io = StringIO.new
+ begin
+ $stdout = stdout_io
+ NosOignons.list_emails!
+ @stdout = stdout_io.string
+ ensure
+ $stdout = STDOUT
+ end
+ end
+end
+
+When /^j'exécute update-ag-subscribers$/ do
+ run_simple 'update-ag-subscribers'
+end
+
+When /^(?:que )?j'exécute send-membership-reminders$/ do
+ NosOignons.send_membership_reminders!
+end
+