]> nos-oignons.net Git - gestion-adh.git/blob - features/support/env.rb
Implement send-membership-reminders
[gestion-adh.git] / features / support / env.rb
1 require 'rubygems'
2 require 'bundler'
3 Bundler.setup
4
5 require 'timecop'
6 require 'tmpdir'
7 require 'aruba/cucumber'
8 require 'safe_yaml'
9 require 'mail'
10
11 SafeYAML::OPTIONS[:default_mode] = :safe
12
13 require 'nos_oignons'
14
15 Before do
16   ENV['GIT_COMMITTER_NAME'] = ENV['GIT_AUTHOR_NAME'] = 'J. Test'
17   ENV['GIT_COMMITTER_EMAIL'] = ENV['GIT_AUTHOR_EMAIL'] = 'test@example.org'
18   @tmpdir = Dir.mktmpdir('gestion-adh')
19   @dirs = [@tmpdir]
20   @aruba_io_wait_seconds = 0.1
21   @orig_wiki_path = ENV['NOS_OIGNONS_BOARD_WIKI_PATH']
22   @orig_reminder_db_path = ENV['NOS_OIGNONS_REMINDER_DB']
23   ENV['NOS_OIGNONS_REMINDER_DB'] = File.join(current_dir, 'reminders.yaml')
24   NosOignons::ReminderDb.instance.reload!
25   Mail.defaults do
26     delivery_method :test
27   end
28   Mail::TestMailer.deliveries.clear
29 end
30
31 After do
32   ENV['NOS_OIGNONS_REMINDER_DB'] = @orig_reminder_db_path
33   ENV['NOS_OIGNONS_BOARD_WIKI_PATH'] = @orig_wiki_path
34   FileUtils.remove_entry_secure @tmpdir
35 end