Add "-f" to the "rm" call in bin/install-fixtures.sh.
[mailshears.git] / test / mailshears_test.rb
index 483c587a08d0a7682de79def66096ccfe50d4dac..aea8dfcff8812d0802f55a3edfa16953f0c1b8b1 100644 (file)
@@ -17,8 +17,7 @@ class MailshearsTest < MiniTest::Unit::TestCase
     # Check if the given mail directory of the form "example.com/user"
     # exists.
     cfg = configuration()
-    mail_root = cfg.send('mail_root')
-    return File.directory?("#{mail_root}/#{dir}")
+    return File.directory?("#{cfg.dovecot_mail_root()}/#{dir}")
   end
 
   def connect_superuser()
@@ -177,11 +176,10 @@ class MailshearsTest < MiniTest::Unit::TestCase
     cfg = configuration()
 
     # First create the "mail directories".
-    mail_root = cfg.send('mail_root')
-    FileUtils.mkdir_p("#{mail_root}/example.com/alice")
-    FileUtils.mkdir_p("#{mail_root}/example.com/booger")
-    FileUtils.mkdir_p("#{mail_root}/example.com/jeremy")
-    FileUtils.mkdir_p("#{mail_root}/example.net/adam")
+    FileUtils.mkdir_p("#{cfg.dovecot_mail_root()}/example.com/alice")
+    FileUtils.mkdir_p("#{cfg.dovecot_mail_root()}/example.com/booger")
+    FileUtils.mkdir_p("#{cfg.dovecot_mail_root()}/example.com/jeremy")
+    FileUtils.mkdir_p("#{cfg.dovecot_mail_root()}/example.net/adam")
 
     # Now the databases and their content.
     connection = connect_superuser()
@@ -233,8 +231,7 @@ class MailshearsTest < MiniTest::Unit::TestCase
     connection.close()
 
     # Get rid of the maildirs.
-    mail_root = cfg.send('mail_root')
-    FileUtils.rm_r(mail_root)
+    FileUtils.rm_r(cfg.dovecot_mail_root())
   end
 
 end