projects
/
gestion-adh.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f3e83e5
)
Update to Ruby 2+, RSpec 3 and recent Aruba
author
Lunar
<lunar@anargeek.net>
Wed, 13 Jan 2016 16:10:14 +0000
(17:10 +0100)
committer
Lunar
<lunar@anargeek.net>
Wed, 13 Jan 2016 16:10:14 +0000
(17:10 +0100)
Gemfile.lock
patch
|
blob
|
history
features/step_definitions/commands.rb
patch
|
blob
|
history
features/step_definitions/emails.rb
patch
|
blob
|
history
features/step_definitions/git.rb
patch
|
blob
|
history
features/step_definitions/mailman.rb
patch
|
blob
|
history
features/step_definitions/members.rb
patch
|
blob
|
history
features/step_definitions/receipts.rb
patch
|
blob
|
history
features/support/env.rb
patch
|
blob
|
history
features/support/fixtures.rb
patch
|
blob
|
history
diff --git
a/Gemfile.lock
b/Gemfile.lock
index 869fed923de323b08167da79202ee16c99fdbb67..104eb02cda2cc49bbd4d87978f1a53024ce148c0 100644
(file)
--- a/
Gemfile.lock
+++ b/
Gemfile.lock
@@
-9,52
+9,49
@@
PATH
GEM
remote: https://rubygems.org/
specs:
GEM
remote: https://rubygems.org/
specs:
- Ascii85 (1.0.2)
- afm (0.2.0)
- aruba (0.5.3)
- childprocess (>= 0.3.6)
- cucumber (>= 1.1.1)
- rspec-expectations (>= 2.7.0)
+ aruba (0.12.0)
+ childprocess (~> 0.5.6)
+ contracts (~> 0.9)
+ cucumber (>= 1.3.19)
+ event-bus (~> 0.2)
+ ffi (~> 1.9.10)
+ rspec-expectations (>= 2.99)
+ thor (~> 0.19)
builder (3.2.2)
builder (3.2.2)
- childprocess (0.
3
.9)
+ childprocess (0.
5
.9)
ffi (~> 1.0, >= 1.0.11)
ffi (~> 1.0, >= 1.0.11)
- cucumber (1.3.10)
+ contracts (0.12.0)
+ cucumber (2.1.0)
builder (>= 2.1.2)
builder (>= 2.1.2)
+ cucumber-core (~> 1.3.0)
diff-lcs (>= 1.1.3)
diff-lcs (>= 1.1.3)
- gherkin
(~> 2.12
)
+ gherkin
3 (~> 3.1.0
)
multi_json (>= 1.7.5, < 2.0)
multi_json (>= 1.7.5, < 2.0)
- multi_test (>= 0.0.2)
+ multi_test (>= 0.1.2)
+ cucumber-core (1.3.1)
+ gherkin3 (~> 3.1.0)
diff-lcs (1.2.5)
diff-lcs (1.2.5)
- ffi (1.9.3)
- gherkin (2.12.2)
- multi_json (~> 1.3)
- hashery (2.1.1)
+ event-bus (0.2.3)
+ ffi (1.9.10)
+ gherkin3 (3.1.2)
json (1.7.7)
json (1.7.7)
- mail (2.5.4)
- mime-types (~> 1.16)
- treetop (~> 1.4.8)
- mime-types (1.25.1)
- multi_json (1.8.2)
- multi_test (0.0.2)
- pdf-reader (1.3.3)
- Ascii85 (~> 1.0.0)
- afm (~> 0.2.0)
- hashery (~> 2.0)
- ruby-rc4
- ttfunk
- polyglot (0.3.3)
- prawn (0.12.0)
- pdf-reader (>= 0.9.0)
- ttfunk (~> 1.0.2)
- rspec-expectations (2.14.4)
- diff-lcs (>= 1.1.3, < 2.0)
- ruby-rc4 (0.1.5)
- safe_yaml (0.9.7)
- timecop (0.7.0)
- treetop (1.4.15)
- polyglot
- polyglot (>= 0.3.1)
- ttfunk (1.0.3)
+ mail (2.6.3)
+ mime-types (>= 1.16, < 3)
+ mime-types (2.99)
+ multi_json (1.11.2)
+ multi_test (0.1.2)
+ pdf-core (0.6.0)
+ prawn (2.0.2)
+ pdf-core (~> 0.6.0)
+ ttfunk (~> 1.4.0)
+ rspec-expectations (3.4.0)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.4.0)
+ rspec-support (3.4.1)
+ safe_yaml (1.0.4)
+ thor (0.19.1)
+ timecop (0.8.0)
+ ttfunk (1.4.0)
PLATFORMS
ruby
PLATFORMS
ruby
diff --git
a/features/step_definitions/commands.rb
b/features/step_definitions/commands.rb
index 154c4e9d4ae13790898d6090dec9a5b56ce22191..e0b5ea4a3737ee5483728b508178a45aa564e017 100644
(file)
--- a/
features/step_definitions/commands.rb
+++ b/
features/step_definitions/commands.rb
@@
-34,7
+34,7
@@
When /^j'exécute list-emails le (\d+)\-(\d+)\-(\d+)$/ do |year, month, day|$/
end
When /^j'exécute update-ag-subscribers$/ do
end
When /^j'exécute update-ag-subscribers$/ do
- run_simple 'update-ag-subscribers'
+ NosOignons.update_ag_subscribers!
end
When /^(?:que )?j'exécute send-membership-reminders$/ do
end
When /^(?:que )?j'exécute send-membership-reminders$/ do
@@
-52,26
+52,30
@@
When /^j'exécute send\-member\-emails\-to\-advisors$/ do
end
When /^j'exécute `(create\-membership\-fee\-receipt.*)`$/ do |cmd|
end
When /^j'exécute `(create\-membership\-fee\-receipt.*)`$/ do |cmd|
- run_simple cmd, false
+ run_simple cmd,
:fail_on_error =>
false
end
Then /^je ne dois pas avoir eu d'erreur$/ do
end
Then /^je ne dois pas avoir eu d'erreur$/ do
-
assert
_exit_status(0)
+
expect(last_command_started).to have
_exit_status(0)
end
Then /^je dois voir comme erreur "(.*?)"$/ do |expected|
end
Then /^je dois voir comme erreur "(.*?)"$/ do |expected|
- assert_failing_with(expected)
+ expect(last_command_started).to have_output_on_stderr /#{Regexp.escape(expected)}/
end
Then /^la sortie doit être vide$/ do
end
Then /^la sortie doit être vide$/ do
-
assert_exact_output('', @stdout || all_stdout
)
+
expect(last_command_started).to have_output_on_stdout(''
)
end
Then /^la sortie doit être:$/ do |expected|
# add an extra line feed for nice scenario
end
Then /^la sortie doit être:$/ do |expected|
# add an extra line feed for nice scenario
-
assert_exact_output(expected + "\n", @stdout || all_stdout
)
+
expect(last_command_started).to have_output_on_stdout(expected
)
end
Then /^la sortie doit être "([^"]*)"$/ do |expected|
end
Then /^la sortie doit être "([^"]*)"$/ do |expected|
- assert_exact_output(expected, (@stdout || all_stdout).rstrip)
+ begin
+ expect(last_command_started).to have_output_on_stdout(expected)
+ rescue Aruba::NoCommandHasBeenStartedError
+ expect(@stdout.rstrip).to eq(expected)
+ end
end
end
diff --git
a/features/step_definitions/emails.rb
b/features/step_definitions/emails.rb
index c6935e6d26be7dccb8adaf4cd2df7b16880774a4..e5e4fab7577aedd0369dcf2b188c3b9ef2671fb2 100644
(file)
--- a/
features/step_definitions/emails.rb
+++ b/
features/step_definitions/emails.rb
@@
-17,11
+17,11
@@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Then /^aucun email ne doit avoir été envoyé$/ do
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Then /^aucun email ne doit avoir été envoyé$/ do
- Mail::TestMailer.deliveries.should be_empty
+ expect(Mail::TestMailer.deliveries.size).to eq(0)
end
Then /^un appel pour la cotisation doit avoir été envoyé$/ do
end
Then /^un appel pour la cotisation doit avoir été envoyé$/ do
- Mail::TestMailer.deliveries.should have(1).email
+ expect(Mail::TestMailer.deliveries.size).to eq(1)
mail = Mail::TestMailer.deliveries.first
expect(mail.from).to eql([NosOignons::BOARD_EMAIL])
expect(mail.to).to eql([@last_member['email']])
mail = Mail::TestMailer.deliveries.first
expect(mail.from).to eql([NosOignons::BOARD_EMAIL])
expect(mail.to).to eql([@last_member['email']])
@@
-41,19
+41,19
@@
Then /^un (premier|dernier) rappel pour la cotisation doit avoir été envoyé$/
end
Then /^(\d+) emails? (?:doit|doivent) avoir été envoyés?$/ do |count|
end
Then /^(\d+) emails? (?:doit|doivent) avoir été envoyés?$/ do |count|
- Mail::TestMailer.deliveries.should have(count).email
+ expect(Mail::TestMailer.deliveries.size).to eq(count.to_i)
end
Then /^des emails doivent avoir été envoyés à Jane, Fatima, Fred et Moly$/ do
recipients = Mail::TestMailer.deliveries.collect(&:to)
end
Then /^des emails doivent avoir été envoyés à Jane, Fatima, Fred et Moly$/ do
recipients = Mail::TestMailer.deliveries.collect(&:to)
-
recipients.should
include(['jane@example.org'])
-
recipients.should
include(['fatima@example.org'])
-
recipients.should
include(['fred@example.org'])
-
recipients.should
include(['moly@example.org'])
+
expect(recipients).to
include(['jane@example.org'])
+
expect(recipients).to
include(['fatima@example.org'])
+
expect(recipients).to
include(['fred@example.org'])
+
expect(recipients).to
include(['moly@example.org'])
end
Then /^un email doit avoir été envoyé au comité de déontologie$/ do
end
Then /^un email doit avoir été envoyé au comité de déontologie$/ do
- expect(Mail::TestMailer.deliveries
).to have(1).email
+ expect(Mail::TestMailer.deliveries
.size).to eq(1)
expect(Mail::TestMailer.deliveries.first.to).to include('deontologie@nos-oignons.net')
end
expect(Mail::TestMailer.deliveries.first.to).to include('deontologie@nos-oignons.net')
end
diff --git
a/features/step_definitions/git.rb
b/features/step_definitions/git.rb
index abd3e765615288000ab436d436cde368f4d02b88..3ea8a8b6fb486805a07941f2de97a855cda00563 100644
(file)
--- a/
features/step_definitions/git.rb
+++ b/
features/step_definitions/git.rb
@@
-20,19
+20,19
@@
require 'fileutils'
Given /^un clone du Git contenant les adhésions$/ do
# Create main repository
Given /^un clone du Git contenant les adhésions$/ do
# Create main repository
- create_dir 'main'
+ @main_repository_path = expand_path('main')
+ create_directory 'main'
cd 'main'
cd 'main'
- @main_repository_path = current_dir
run_simple 'git init --quiet --bare'
cd '..'
# Clone it now
run_simple 'git init --quiet --bare'
cd '..'
# Clone it now
- run_simple "git clone --quiet --local file://#{
current_dir
}/main clone"
+ run_simple "git clone --quiet --local file://#{
expand_path('.')
}/main clone"
cd 'clone'
cd 'clone'
- create_dir 'Membres'
+ create_dir
ectory
'Membres'
BASE_MEMBERS.each_pair do |number, data|
file = member_filename_for_id(number)
BASE_MEMBERS.each_pair do |number, data|
file = member_filename_for_id(number)
-
write_fil
e file, render_member_file(data)
+
File.writ
e file, render_member_file(data)
run_simple "git add #{file}"
end
run_simple 'git commit -m "Initial data set from fixtures"'
run_simple "git add #{file}"
end
run_simple 'git commit -m "Initial data set from fixtures"'
@@
-41,7
+41,7
@@
end
Given /^le « pre-commit hook » correctement configuré$/ do
FileUtils.ln_s File.expand_path('../../../bin/pre-commit-hook', __FILE__),
Given /^le « pre-commit hook » correctement configuré$/ do
FileUtils.ln_s File.expand_path('../../../bin/pre-commit-hook', __FILE__),
- "#{
current_dir
}/.git/hooks/pre-commit"
+ "#{
expand_path('.')
}/.git/hooks/pre-commit"
end
Given /^le « pre-receive hook » configuré sur le dépôt principal$/ do
end
Given /^le « pre-receive hook » configuré sur le dépôt principal$/ do
diff --git
a/features/step_definitions/mailman.rb
b/features/step_definitions/mailman.rb
index 4d375c4fbe26220fce537992c7ebb3a00024d83a..e201bab96bc9591f8a6f306db9a242846387702a 100644
(file)
--- a/
features/step_definitions/mailman.rb
+++ b/
features/step_definitions/mailman.rb
@@
-19,7
+19,7
@@
require 'json'
Before('@mailman') do
require 'json'
Before('@mailman') do
- @mock_mailman_db =
"#{current_dir}/mock_mailman.json"
+ @mock_mailman_db =
expand_path('mock_mailman.json')
init_mailman_mock_db({})
ENV['MOCK_MAILMAN_DB'] = @mock_mailman_db
@orig_path = ENV['PATH']
init_mailman_mock_db({})
ENV['MOCK_MAILMAN_DB'] = @mock_mailman_db
@orig_path = ENV['PATH']
diff --git
a/features/step_definitions/members.rb
b/features/step_definitions/members.rb
index 880f67e6af6d701a0361728742d4dba2f58ecbf5..0ec5ae1278589a909c16993a387af0857df536fd 100644
(file)
--- a/
features/step_definitions/members.rb
+++ b/
features/step_definitions/members.rb
@@
-17,9
+17,9
@@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
def init_db
# along with this program. If not, see <http://www.gnu.org/licenses/>.
def init_db
- @member_db_path = File.join(current_dir, NosOignons::MEMBERS_DB_DIR)
- ENV['NOS_OIGNONS_BOARD_WIKI_PATH'] = current_dir
- create_dir @member_db_path
+ create_directory NosOignons::MEMBERS_DB_DIR
+ @member_db_path = expand_path(NosOignons::MEMBERS_DB_DIR)
+ ENV['NOS_OIGNONS_BOARD_WIKI_PATH'] = expand_path('.')
end
def create_new_member(name, joined_on, paid_on)
end
def create_new_member(name, joined_on, paid_on)
@@
-31,7
+31,7
@@
def create_new_member(name, joined_on, paid_on)
}
init_db unless @member_db_path
file = member_filename_for_id(new_id)
}
init_db unless @member_db_path
file = member_filename_for_id(new_id)
-
write_fil
e file, render_member_file(@last_member)
+
File.writ
e file, render_member_file(@last_member)
end
Given /une base de membres vide$/ do
end
Given /une base de membres vide$/ do
@@
-57,21
+57,21
@@
end
Given /^une base avec (\w+), membre (\w+), ayant cotisé le ([0-9-]+)$/ do |name, member_id, paid_on|
create_new_member(name, paid_on, paid_on)
Given /^une base avec (\w+), membre (\w+), ayant cotisé le ([0-9-]+)$/ do |name, member_id, paid_on|
create_new_member(name, paid_on, paid_on)
- expect(File.read(
File.join(current_dir, member_filename_for_id(member_id)
))).to include(name)
+ expect(File.read(
member_filename_for_id(member_id
))).to include(name)
end
Given /^une base avec (\w+), membre (\w+), n'ayant jamais cotisé$/ do |name, member_id|
joined_on = (Time.now - 3600*24*30).strftime('%Y-%m-%d')
create_new_member(name, joined_on, nil)
end
Given /^une base avec (\w+), membre (\w+), n'ayant jamais cotisé$/ do |name, member_id|
joined_on = (Time.now - 3600*24*30).strftime('%Y-%m-%d')
create_new_member(name, joined_on, nil)
- expect(File.read(
File.join(current_dir, member_filename_for_id(member_id)
))).to include(name)
+ expect(File.read(
member_filename_for_id(member_id
))).to include(name)
end
Given /^une base avec uniquement (\w+), membre (\w+)$/ do |name, member_id|
paid_on = (Time.now - 3600*24*30).strftime('%Y-%m-%d')
create_new_member(name, paid_on, paid_on)
end
Given /^une base avec uniquement (\w+), membre (\w+)$/ do |name, member_id|
paid_on = (Time.now - 3600*24*30).strftime('%Y-%m-%d')
create_new_member(name, paid_on, paid_on)
- member_path = File.join(
current_dir,
member_filename_for_id(member_id))
+ member_path = File.join(member_filename_for_id(member_id))
expect(File.read(member_path)).to include(name)
expect(File.read(member_path)).to include(name)
- expect(Dir.glob("#{@member_db_path}/[0-9]*")
).to have(1).member
+ expect(Dir.glob("#{@member_db_path}/[0-9]*")
.size).to eq(1)
end
end
@@
-107,24
+107,24
@@
end
When /^j'ajoute une fiche correcte pour une nouvelle adhésion$/ do
@file = member_filename_for_id(new_id)
When /^j'ajoute une fiche correcte pour une nouvelle adhésion$/ do
@file = member_filename_for_id(new_id)
-
write_fil
e @file, render_member_file(EXTRA_MEMBER)
+
File.writ
e @file, render_member_file(EXTRA_MEMBER)
end
When /^j'ajoute une fiche vide$/ do
@file = member_filename_for_id(new_id)
end
When /^j'ajoute une fiche vide$/ do
@file = member_filename_for_id(new_id)
-
write_fil
e @file, ''
+
File.writ
e @file, ''
end
When /^j'ajoute une fiche sans YAML$/ do
@file = member_filename_for_id(new_id)
end
When /^j'ajoute une fiche sans YAML$/ do
@file = member_filename_for_id(new_id)
-
write_fil
e @file, <<-EOF.gsub(/^ /, '')
+
File.writ
e @file, <<-EOF.gsub(/^ /, '')
Ceci est une fiche sans YAML.
EOF
end
When /^j'ajoute une fiche avec du mauvais YAML$/ do
@file = member_filename_for_id(new_id)
Ceci est une fiche sans YAML.
EOF
end
When /^j'ajoute une fiche avec du mauvais YAML$/ do
@file = member_filename_for_id(new_id)
-
write_fil
e @file, <<-EOF.gsub(/^ /, '')
+
File.writ
e @file, <<-EOF.gsub(/^ /, '')
---
[This is missing a closing bracket
---
---
[This is missing a closing bracket
---
@@
-133,7
+133,7
@@
end
When /^j'ajoute une fiche sans email$/ do
@file = member_filename_for_id(new_id)
When /^j'ajoute une fiche sans email$/ do
@file = member_filename_for_id(new_id)
-
write_fil
e @file, <<-EOF.gsub(/^ /, '')
+
File.writ
e @file, <<-EOF.gsub(/^ /, '')
---
name: J. Example
address: |
---
name: J. Example
address: |
@@
-147,7
+147,7
@@
end
When /^j'ajoute une fiche sans nom$/ do
@file = member_filename_for_id(new_id)
When /^j'ajoute une fiche sans nom$/ do
@file = member_filename_for_id(new_id)
-
write_fil
e @file, <<-EOF.gsub(/^ /, '')
+
File.writ
e @file, <<-EOF.gsub(/^ /, '')
---
email: joe@example.org
address: |
---
email: joe@example.org
address: |
@@
-161,7
+161,7
@@
end
When /^j'ajoute une fiche avec comme date d'adhésion "([^"]*)"$/ do |date|
@file = member_filename_for_id(new_id)
When /^j'ajoute une fiche avec comme date d'adhésion "([^"]*)"$/ do |date|
@file = member_filename_for_id(new_id)
-
write_fil
e @file, <<-EOF.gsub(/^ /, '')
+
File.writ
e @file, <<-EOF.gsub(/^ /, '')
---
name: J. Example
email: joe@example.org
---
name: J. Example
email: joe@example.org
@@
-176,7
+176,7
@@
end
When /^j'ajoute une fiche avec comme date de cotisation "([^"]*)"$/ do |date|
@file = member_filename_for_id(new_id)
When /^j'ajoute une fiche avec comme date de cotisation "([^"]*)"$/ do |date|
@file = member_filename_for_id(new_id)
-
write_fil
e @file, <<-EOF.gsub(/^ /, '')
+
File.writ
e @file, <<-EOF.gsub(/^ /, '')
---
name: J. Example
email: joe@example.org
---
name: J. Example
email: joe@example.org
@@
-195,6
+195,6
@@
When /^je supprime le nom sur une fiche existante$/ do
end
When /^j'ajoute un fichier hors de la base des adhérents$/ do
end
When /^j'ajoute un fichier hors de la base des adhérents$/ do
- @file =
'test'
-
write_fil
e @file, 'Test content.'
+ @file =
expand_path('test')
+
File.writ
e @file, 'Test content.'
end
end
diff --git
a/features/step_definitions/receipts.rb
b/features/step_definitions/receipts.rb
index 6e9c300ae0a12ee5b5667c5892d99354defee4b1..9656badf888a7f94decec54816a49c8f5085b9fa 100644
(file)
--- a/
features/step_definitions/receipts.rb
+++ b/
features/step_definitions/receipts.rb
@@
-18,7
+18,7
@@
Then /^le fichier "(.*)" doit avoir été créé avec les reçus$/ do |filename|
@receipt_path = "#{ENV['NOS_OIGNONS_RECEIPTS_DIR']}/#{filename}"
Then /^le fichier "(.*)" doit avoir été créé avec les reçus$/ do |filename|
@receipt_path = "#{ENV['NOS_OIGNONS_RECEIPTS_DIR']}/#{filename}"
- expect(File.exists?(@receipt_path)).to be_tru
e
+ expect(File.exists?(@receipt_path)).to be_tru
thy
end
Then /^il doit contenir le nom et l'adresse de (\w+), la date et le montant de la cotisation$/ do |name|
end
Then /^il doit contenir le nom et l'adresse de (\w+), la date et le montant de la cotisation$/ do |name|
diff --git
a/features/support/env.rb
b/features/support/env.rb
index 7779bab6c5ade2538a7b6954344fbffb017e2961..ae8c5c3a1fe9a49ae58437715edf06db6631f5b2 100644
(file)
--- a/
features/support/env.rb
+++ b/
features/support/env.rb
@@
-28,21
+28,22
@@
require 'mail'
SafeYAML::OPTIONS[:default_mode] = :safe
SafeYAML::OPTIONS[:default_mode] = :safe
+Aruba.configure do |config|
+ config.io_wait_timeout = 0.1
+ config.exit_timeout = 20
+end
+
require 'nos_oignons'
Before do
ENV['GIT_COMMITTER_NAME'] = ENV['GIT_AUTHOR_NAME'] = 'J. Test'
ENV['GIT_COMMITTER_EMAIL'] = ENV['GIT_AUTHOR_EMAIL'] = 'test@example.org'
require 'nos_oignons'
Before do
ENV['GIT_COMMITTER_NAME'] = ENV['GIT_AUTHOR_NAME'] = 'J. Test'
ENV['GIT_COMMITTER_EMAIL'] = ENV['GIT_AUTHOR_EMAIL'] = 'test@example.org'
- @tmpdir = Dir.mktmpdir('gestion-adh')
- @dirs = [@tmpdir]
- @aruba_io_wait_seconds = 0.1
- @aruba_timeout_seconds = 20
@orig_wiki_path = ENV['NOS_OIGNONS_BOARD_WIKI_PATH']
@orig_reminder_db_path = ENV['NOS_OIGNONS_REMINDER_DB']
@orig_receipts_dir = ENV['NOS_OIGNONS_RECEIPTS_DIR']
@orig_wiki_path = ENV['NOS_OIGNONS_BOARD_WIKI_PATH']
@orig_reminder_db_path = ENV['NOS_OIGNONS_REMINDER_DB']
@orig_receipts_dir = ENV['NOS_OIGNONS_RECEIPTS_DIR']
- ENV['NOS_OIGNONS_REMINDER_DB'] =
File.join(current_dir,
'reminders.yaml')
+ ENV['NOS_OIGNONS_REMINDER_DB'] =
expand_path(
'reminders.yaml')
NosOignons::ReminderDb.instance.reload!
NosOignons::ReminderDb.instance.reload!
- ENV['NOS_OIGNONS_RECEIPTS_DIR'] =
File.join(current_dir,
'receipts')
+ ENV['NOS_OIGNONS_RECEIPTS_DIR'] =
expand_path(
'receipts')
FileUtils.mkdir(ENV['NOS_OIGNONS_RECEIPTS_DIR'])
Mail.defaults do
delivery_method :test
FileUtils.mkdir(ENV['NOS_OIGNONS_RECEIPTS_DIR'])
Mail.defaults do
delivery_method :test
@@
-54,5
+55,4
@@
After do
ENV['NOS_OIGNONS_REMINDER_DB'] = @orig_reminder_db_path
ENV['NOS_OIGNONS_BOARD_WIKI_PATH'] = @orig_wiki_path
ENV['NOS_OIGNONS_RECEIPTS_DIR'] = @orig_receipts_dir
ENV['NOS_OIGNONS_REMINDER_DB'] = @orig_reminder_db_path
ENV['NOS_OIGNONS_BOARD_WIKI_PATH'] = @orig_wiki_path
ENV['NOS_OIGNONS_RECEIPTS_DIR'] = @orig_receipts_dir
- FileUtils.remove_entry_secure @tmpdir
end
end
diff --git
a/features/support/fixtures.rb
b/features/support/fixtures.rb
index 32142b23ab45cdc591780cc908e0d3a463480916..42d46ee21a7c33dfbf0df359ca7faf4960f37afd 100644
(file)
--- a/
features/support/fixtures.rb
+++ b/
features/support/fixtures.rb
@@
-84,7
+84,7
@@
membership_fee_paid_on: <%= membership_fee_paid_on %>
END_OF_TEMPLATE
def member_filename_for_id(id)
END_OF_TEMPLATE
def member_filename_for_id(id)
- "Membres/%06d.mdwn" % id
+ expand_path("Membres/%06d.mdwn" % id)
end
def render_member_file(locals)
end
def render_member_file(locals)
@@
-92,7
+92,7
@@
def render_member_file(locals)
end
def new_id
end
def new_id
- max_id = Dir.glob("#{
current_dir}/Membres
/*.mdwn").
+ max_id = Dir.glob("#{
expand_path('Membres')}
/*.mdwn").
collect { |f| File.basename(f).gsub(/\.mdwn$/, '').to_i }.max || 0
max_id + 1
end
collect { |f| File.basename(f).gsub(/\.mdwn$/, '').to_i }.max || 0
max_id + 1
end