sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 52f7c16a39ca4f3ec5005a83296e2fcc8fc0403e
parent 3e1acd284018af84fb071c4ea17fabda08c566ce
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date:   Sun,  6 Jun 2010 09:02:24 -0700

instantiate enough singletons for a null query

Diffstat:
M test/test_server.rb | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/test/test_server.rb b/test/test_server.rb
@@ -64,7 +64,11 @@ class TestServer < Test::Unit::TestCase
     EM.spawn_reactor_thread
     @path = Dir.mktmpdir
     socket_path = File.join(@path, 'socket')
-    Redwood::Index.init File.join(@path, 'index')
+    Redwood::SourceManager.init
+    Redwood::SourceManager.load_sources File.join(@path, 'sources.yaml')
+    Redwood::Index.init @path
+    Redwood::SearchManager.init File.join(@path, 'searches')
+    Redwood::Index.load
     @server = EM.start_server socket_path,
               Redwood::Server, Redwood::Index.instance
     @client = EM.connect socket_path, QueueingClient
@@ -74,7 +78,9 @@ class TestServer < Test::Unit::TestCase
   def teardown
     FileUtils.rm_r @path if passed?
     puts "not cleaning up #{@path}" unless passed?
-    Redwood::Index.deinstantiate!
+    %w(Index SearchManager SourceManager).each do |x|
+      Redwood.const_get(x.to_sym).deinstantiate!
+    end
     EM.kill_reactor_thread
   end