]> nos-oignons.net Git - gestion-adh.git/blob - features/support/env.rb
Add missing require to load ERB
[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   @aruba_timeout_seconds = 20
22   @orig_wiki_path = ENV['NOS_OIGNONS_BOARD_WIKI_PATH']
23   @orig_reminder_db_path = ENV['NOS_OIGNONS_REMINDER_DB']
24   ENV['NOS_OIGNONS_REMINDER_DB'] = File.join(current_dir, 'reminders.yaml')
25   NosOignons::ReminderDb.instance.reload!
26   Mail.defaults do
27     delivery_method :test
28   end
29   Mail::TestMailer.deliveries.clear
30 end
31
32 After do
33   ENV['NOS_OIGNONS_REMINDER_DB'] = @orig_reminder_db_path
34   ENV['NOS_OIGNONS_BOARD_WIKI_PATH'] = @orig_wiki_path
35   FileUtils.remove_entry_secure @tmpdir
36 end