author | Mahlon E. Smith <mahlon@laika.com> |
Tue, 16 May 2017 13:58:34 -0700 | |
changeset 17 | 23c7f5c8ee39 |
parent 15 | a38e6916504c |
child 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' |
1
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
6 |
|
15 | 7 |
require_relative '../lib/ezmlm' |
8 |
||
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
9 |
module SpecHelpers |
14 | 10 |
include FileUtils |
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
11 |
|
14 | 12 |
TEST_LIST_NAME = 'waffle-lovers' |
13 |
TEST_LIST_HOST = 'lists.syrup.info' |
|
14 |
TEST_OWNER = 'listowner@rumpus-the-whale.info' |
|
15 |
||
16 |
TEST_SUBSCRIBERS = %w[ |
|
17 |
pete.chaffee@toadsmackers.com |
|
18 |
dolphinzombie@alahalohamorra.com |
|
19 |
piratebanker@yahoo.com |
|
20 |
] |
|
21 |
||
22 |
TEST_MODERATORS = %w[ |
|
23 |
dolphinzombie@alahalohamorra.com |
|
24 |
] |
|
1
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
25 |
|
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 |
module_function |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
28 |
############### |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
29 |
|
14 | 30 |
### 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
|
31 |
### |
14 | 32 |
def make_listdir |
33 |
dirname = "/tmp/%s.%d.%0.4f" % [ |
|
34 |
'ezmlm_list', |
|
1
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
35 |
Process.pid, |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
36 |
(Time.now.to_f % 3600), |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
37 |
] |
14 | 38 |
list = Pathname.new( __FILE__ ).dirname + 'data' + 'testlist' |
39 |
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
|
40 |
|
14 | 41 |
return dirname |
1
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
42 |
end |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
43 |
end |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
44 |
|
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
45 |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
46 |
RSpec.configure do |config| |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
47 |
include SpecHelpers |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
48 |
|
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
49 |
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
|
50 |
config.filter_run :focus |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
51 |
config.order = 'random' |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
52 |
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
|
53 |
mock.syntax = :expect |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
54 |
end |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
55 |
|
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
56 |
config.include( SpecHelpers ) |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
57 |
end |
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
58 |
|
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
1
diff
changeset
|
59 |