spec/spec_helpers.rb
changeset 14 cba9fb39bcdb
parent 12 3cc813140c80
child 15 a38e6916504c
--- a/spec/spec_helpers.rb	Fri Feb 03 10:52:46 2017 -0800
+++ b/spec/spec_helpers.rb	Mon Feb 06 11:54:16 2017 -0800
@@ -3,28 +3,41 @@
 require 'simplecov' if ENV['COVERAGE']
 require 'rspec'
 require 'loggability/spechelpers'
+require 'fileutils'
 
 module SpecHelpers
+	include FileUtils
 
-	TEST_LISTSDIR = ENV['TEST_LISTSDIR'] || '/tmp/lists'
+	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
+	]
 
 	###############
 	module_function
 	###############
 
-	### Create a temporary working directory and return
-	### a Pathname object for it.
+	### Create a copy of a fresh listdir into /tmp.
 	###
-	def make_tempdir
-		dirname = "%s.%d.%0.4f" % [
-			'ezmlm_spec',
+	def make_listdir
+		dirname = "/tmp/%s.%d.%0.4f" % [
+			'ezmlm_list',
 			Process.pid,
 			(Time.now.to_f % 3600),
 		  ]
-		tempdir = Pathname.new( Dir.tmpdir ) + dirname
-		tempdir.mkpath
+		list = Pathname.new( __FILE__ ).dirname + 'data' + 'testlist'
+		cp_r( list.to_s, dirname )
 
-		return tempdir
+		return dirname
 	end
 end