2017-02-01 15:35:35 -08:00
|
|
|
#!/usr/bin/ruby
|
|
|
|
|
|
|
|
|
|
require 'simplecov' if ENV['COVERAGE']
|
|
|
|
|
require 'rspec'
|
2017-02-06 11:54:16 -08:00
|
|
|
require 'fileutils'
|
2017-05-16 15:52:05 -07:00
|
|
|
require 'tmpdir'
|
2017-02-01 15:35:35 -08:00
|
|
|
|
2017-05-12 11:09:36 -07:00
|
|
|
require_relative '../lib/ezmlm'
|
|
|
|
|
|
2017-02-01 15:35:35 -08:00
|
|
|
module SpecHelpers
|
2017-02-06 11:54:16 -08:00
|
|
|
include FileUtils
|
2017-02-01 15:35:35 -08:00
|
|
|
|
2017-02-06 11:54:16 -08:00
|
|
|
TEST_LIST_NAME = 'waffle-lovers'
|
|
|
|
|
TEST_LIST_HOST = 'lists.syrup.info'
|
|
|
|
|
TEST_OWNER = 'listowner@rumpus-the-whale.info'
|
|
|
|
|
|
|
|
|
|
TEST_SUBSCRIBERS = %w[
|
|
|
|
|
pete.chaffee@toadsmackers.com
|
|
|
|
|
dolphinzombie@alahalohamorra.com
|
|
|
|
|
piratebanker@yahoo.com
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
TEST_MODERATORS = %w[
|
|
|
|
|
dolphinzombie@alahalohamorra.com
|
|
|
|
|
]
|
2017-02-01 15:35:35 -08:00
|
|
|
|
|
|
|
|
###############
|
|
|
|
|
module_function
|
|
|
|
|
###############
|
|
|
|
|
|
2017-02-06 11:54:16 -08:00
|
|
|
### Create a copy of a fresh listdir into /tmp.
|
2017-02-01 15:35:35 -08:00
|
|
|
###
|
2017-02-06 11:54:16 -08:00
|
|
|
def make_listdir
|
2017-05-16 15:52:05 -07:00
|
|
|
dirname = "%s/%s.%d.%0.4f" % [
|
|
|
|
|
Dir.tmpdir,
|
2017-02-06 11:54:16 -08:00
|
|
|
'ezmlm_list',
|
2017-02-01 15:35:35 -08:00
|
|
|
Process.pid,
|
|
|
|
|
(Time.now.to_f % 3600),
|
|
|
|
|
]
|
2017-02-06 11:54:16 -08:00
|
|
|
list = Pathname.new( __FILE__ ).dirname + 'data' + 'testlist'
|
|
|
|
|
cp_r( list.to_s, dirname )
|
2017-02-01 15:35:35 -08:00
|
|
|
|
2017-02-06 11:54:16 -08:00
|
|
|
return dirname
|
2017-02-01 15:35:35 -08:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RSpec.configure do |config|
|
|
|
|
|
include SpecHelpers
|
|
|
|
|
|
|
|
|
|
config.run_all_when_everything_filtered = true
|
|
|
|
|
config.filter_run :focus
|
|
|
|
|
config.order = 'random'
|
|
|
|
|
config.mock_with( :rspec ) do |mock|
|
|
|
|
|
mock.syntax = :expect
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
config.include( SpecHelpers )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|