author | Mahlon E. Smith <mahlon@martini.nu> |
Mon, 02 Sep 2019 09:00:47 -0700 | |
changeset 27 | a629597fd647 |
parent 20 | 9d59d30685cb |
permissions | -rw-r--r-- |
1
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/ruby |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
2 |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
3 |
require 'simplecov' if ENV['COVERAGE'] |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
4 |
require 'rspec' |
14 | 5 |
require 'fileutils' |
20
9d59d30685cb
Fixes for documentation and test directories that didn't make it into the repo.
Mahlon E. Smith <mahlon@laika.com>
parents:
17
diff
changeset
|
6 |
require 'tmpdir' |
1
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
7 |
|
15 | 8 |
require_relative '../lib/ezmlm' |
9 |
||
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
10 |
module SpecHelpers |
14 | 11 |
include FileUtils |
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
12 |
|
14 | 13 |
TEST_LIST_NAME = 'waffle-lovers' |
14 |
TEST_LIST_HOST = 'lists.syrup.info' |
|
15 |
TEST_OWNER = 'listowner@rumpus-the-whale.info' |
|
16 |
||
17 |
TEST_SUBSCRIBERS = %w[ |
|
18 |
pete.chaffee@toadsmackers.com |
|
19 |
dolphinzombie@alahalohamorra.com |
|
20 |
piratebanker@yahoo.com |
|
21 |
] |
|
22 |
||
23 |
TEST_MODERATORS = %w[ |
|
24 |
dolphinzombie@alahalohamorra.com |
|
25 |
] |
|
1
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
26 |
|
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
27 |
############### |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
28 |
module_function |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
29 |
############### |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
30 |
|
14 | 31 |
### Create a copy of a fresh listdir into /tmp. |
1
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
32 |
### |
14 | 33 |
def make_listdir |
20
9d59d30685cb
Fixes for documentation and test directories that didn't make it into the repo.
Mahlon E. Smith <mahlon@laika.com>
parents:
17
diff
changeset
|
34 |
dirname = "%s/%s.%d.%0.4f" % [ |
9d59d30685cb
Fixes for documentation and test directories that didn't make it into the repo.
Mahlon E. Smith <mahlon@laika.com>
parents:
17
diff
changeset
|
35 |
Dir.tmpdir, |
14 | 36 |
'ezmlm_list', |
1
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
37 |
Process.pid, |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
38 |
(Time.now.to_f % 3600), |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
39 |
] |
14 | 40 |
list = Pathname.new( __FILE__ ).dirname + 'data' + 'testlist' |
41 |
cp_r( list.to_s, dirname ) |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
42 |
|
14 | 43 |
return dirname |
1
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
44 |
end |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
45 |
end |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
46 |
|
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
47 |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
48 |
RSpec.configure do |config| |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
49 |
include SpecHelpers |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
50 |
|
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
51 |
config.run_all_when_everything_filtered = true |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
52 |
config.filter_run :focus |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
53 |
config.order = 'random' |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
54 |
config.mock_with( :rspec ) do |mock| |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
55 |
mock.syntax = :expect |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
56 |
end |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
57 |
|
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
58 |
config.include( SpecHelpers ) |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
59 |
end |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
60 |
|
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
61 |