spec/ezmlm/list_spec.rb
author Michael Granger <mgranger@laika.com>
Sat, 10 May 2008 01:52:42 +0000
changeset 5 804e1c2b9a40
parent 4 8c4ae0797d5f
child 6 66beb495a861
permissions -rw-r--r--
* Added rdoc-generation to the cruise task and the artifacts that get saved * Added Darkfish external and fixed up the RDoc generation task to use it * Factored out the config-file reading from #owner into a generic config reader, and then added some methods to access config values * Fixed the message-file sort block * Added a DRb service daemon: Ezmlm::ListDaemon
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
     1
#!/usr/bin/env ruby
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
     2
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
     3
BEGIN {
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
     4
	require 'pathname'
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
     5
	basedir = Pathname.new( __FILE__ ).dirname.parent.parent
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
     6
	
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
     7
	libdir = basedir + "lib"
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
     8
	
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
     9
	$LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    10
}
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    11
4
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
    12
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    13
begin
4
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
    14
	require 'tmail'
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    15
	require 'spec/runner'
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    16
	require 'spec/lib/helpers'
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    17
	require 'ezmlm/list'
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    18
rescue LoadError
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    19
	unless Object.const_defined?( :Gem )
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    20
		require 'rubygems'
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    21
		retry
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    22
	end
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    23
	raise
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    24
end
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
describe Ezmlm::List do
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    28
	include Ezmlm::SpecHelpers
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    29
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    30
2
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    31
	LISTDIR = Pathname.new( 'list' )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    32
	TEST_SUBSCRIBERS = %w[
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    33
		pete.chaffee@toadsmackers.com
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    34
		dolphinzombie@alahalohamorra.com
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    35
		piratebanker@yahoo.com
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    36
	  ]
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    37
	TEST_MODERATORS = %w[
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    38
		dolphinzombie@alahalohamorra.com
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    39
	  ]
5
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    40
	TEST_LIST_NAME = 'waffle-lovers'
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    41
	TEST_LIST_HOST = 'lists.syrup.info'
2
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    42
	TEST_OWNER = 'listowner@rumpus-the-whale.info'
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    43
	TEST_CUSTOM_MODERATORS_DIR = '/foo/bar/clowns'
5
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    44
	TEST_CONFIG = <<-"EOF".gsub( /^\t+/, '' )
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    45
		F:-aBCDeFGHijKlMnOpQrStUVWXYZ
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    46
		X:
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    47
		D:/var/qmail/alias/lists/waffle-lovers/
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    48
		T:/var/qmail/alias/.qmail-waffle-lovers
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    49
		L:#{TEST_LIST_NAME}
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    50
		H:#{TEST_LIST_HOST}
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    51
		C:
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    52
		0:
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    53
		3:
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    54
		4:
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    55
		5:#{TEST_OWNER}
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    56
		6:
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    57
		7:
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    58
		8:
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    59
		9:
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    60
	EOF
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    61
	
2
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    62
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    63
	it "can create a new list"
5
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    64
	it "can add a new subscriber"
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    65
	it "can remove a current subscriber"
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    66
	it "can edit the list's text files"
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    67
2
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    68
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    69
	### 
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    70
	### List manager functions
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    71
	### 
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    72
	describe "list manager functions" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    73
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    74
		before( :each ) do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    75
			@listpath = LISTDIR.dup
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    76
			@list = Ezmlm::List.new( @listpath )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    77
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    78
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
    79
		
5
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    80
		it "can return the configured list name" do
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    81
			@list.stub!( :config ).and_return({ 'L' => :the_list_name })
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    82
			@list.name.should == :the_list_name
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    83
		end
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    84
		
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    85
		
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    86
		it "can return the configured list host" do
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    87
			@list.stub!( :config ).and_return({ 'H' => :the_list_host })
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    88
			@list.host.should == :the_list_host
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    89
		end
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    90
		
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    91
		
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    92
		it "can return the configured list address" do
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    93
			@list.stub!( :config ).and_return({ 'L' => TEST_LIST_NAME, 'H' => TEST_LIST_HOST })
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    94
			@list.address.should == "%s@%s" % [ TEST_LIST_NAME, TEST_LIST_HOST ]
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    95
		end
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    96
		
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    97
		
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    98
		CONFIG_KEYS = %w[ F X D T L H C 0 3 4 5 6 7 8 9 ]
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
    99
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   100
		it "can fetch the list config as a Hash" do
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   101
			config_path = mock( "Mock config path" )
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   102
			@listpath.should_receive( :+ ).with( 'config' ).and_return( config_path )
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   103
			config_path.should_receive( :exist? ).and_return( true )
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   104
			config_path.should_receive( :read ).and_return( TEST_CONFIG )
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   105
			
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   106
			@list.config.should be_an_instance_of( Hash )
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   107
			@list.config.should have( CONFIG_KEYS.length ).members
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   108
			@list.config.keys.should include( *CONFIG_KEYS )
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   109
		end
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   110
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   111
		
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   112
		it "raises an error if the list config file doesn't exist" do
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   113
			config_path = mock( "Mock config path" )
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   114
			@listpath.should_receive( :+ ).with( 'config' ).and_return( config_path )
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   115
			config_path.should_receive( :exist? ).and_return( false )
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   116
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   117
			lambda {
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   118
				@list.config
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   119
			}.should raise_error( RuntimeError, /does not exist/ )
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   120
		end
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   121
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   122
		
2
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   123
		it "can return a list of subscribers' email addresses" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   124
			subscribers_dir = LISTDIR + 'subscribers'
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   125
			
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   126
			expectation = Pathname.should_receive( :glob ).with( subscribers_dir + '*' )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   127
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   128
			TEST_SUBSCRIBERS.each do |email|
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   129
				mock_subfile = mock( "Mock subscribers file for '#{email}'" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   130
				mock_subfile.should_receive( :read ).and_return( "T#{email}\0" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   131
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   132
				expectation.and_yield( mock_subfile )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   133
			end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   134
				
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   135
			subscribers = @list.subscribers
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   136
			
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   137
			subscribers.should have(TEST_SUBSCRIBERS.length).members
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   138
			subscribers.should include( *TEST_SUBSCRIBERS )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   139
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   140
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   141
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   142
		### Subscriber moderation
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   143
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   144
		it "knows that subscription moderation is enabled if the dir/modsub file exists" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   145
			modsub_path_obj = mock( "Mock 'modsub' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   146
			@listpath.should_receive( :+ ).with( 'modsub' ).and_return( modsub_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   147
			modsub_path_obj.should_receive( :exist? ).and_return( true )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   148
			
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   149
			@list.should be_closed()
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   150
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   151
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   152
		it "knows that subscription moderation is enabled if the dir/remote file exists" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   153
			modsub_path_obj = mock( "Mock 'modsub' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   154
			@listpath.should_receive( :+ ).with( 'modsub' ).and_return( modsub_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   155
			modsub_path_obj.should_receive( :exist? ).and_return( false )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   156
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   157
			remote_path_obj = mock( "Mock 'remote' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   158
			@listpath.should_receive( :+ ).with( 'remote' ).and_return( remote_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   159
			remote_path_obj.should_receive( :exist? ).and_return( true )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   160
			
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   161
			@list.should be_closed()
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   162
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   163
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   164
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   165
		it "knows that subscription moderation is disabled if neither the dir/modsub nor " +
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   166
		   "dir/remote files exist" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   167
			modsub_path_obj = mock( "Mock 'modsub' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   168
			@listpath.should_receive( :+ ).with( 'modsub' ).and_return( modsub_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   169
			modsub_path_obj.should_receive( :exist? ).and_return( false )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   170
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   171
			remote_path_obj = mock( "Mock 'remote' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   172
			@listpath.should_receive( :+ ).with( 'remote' ).and_return( remote_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   173
			remote_path_obj.should_receive( :exist? ).and_return( false )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   174
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   175
			@list.should_not be_closed()
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   176
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   177
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   178
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   179
		it "returns an empty array of subscription moderators for an open list" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   180
			modsub_path_obj = mock( "Mock 'modsub' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   181
			@listpath.should_receive( :+ ).with( 'modsub' ).and_return( modsub_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   182
			modsub_path_obj.should_receive( :exist? ).and_return( false )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   183
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   184
			remote_path_obj = mock( "Mock 'remote' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   185
			@listpath.should_receive( :+ ).with( 'remote' ).and_return( remote_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   186
			remote_path_obj.should_receive( :exist? ).and_return( false )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   187
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   188
			@list.subscription_moderators.should be_empty()
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   189
		end
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
   190
	
2
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   191
		it "can return a list of subscription moderators' email addresses" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   192
			# Test the moderation config files for existence
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   193
			modsub_path_obj = mock( "Mock 'modsub' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   194
			@listpath.should_receive( :+ ).with( 'modsub' ).twice.and_return( modsub_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   195
			modsub_path_obj.should_receive( :exist? ).twice.and_return( true )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   196
			remote_path_obj = mock( "Mock 'remote' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   197
			@listpath.should_receive( :+ ).with( 'remote' ).and_return( remote_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   198
			remote_path_obj.should_receive( :exist? ).once.and_return( true )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   199
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   200
			# Try to read directory names from both config files
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   201
			modsub_path_obj.should_receive( :read ).with( 1 ).and_return( nil )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   202
			remote_path_obj.should_receive( :read ).with( 1 ).and_return( nil )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   203
			
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   204
			# Read subscribers from the default directory
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   205
			subscribers_dir = mock( "Mock moderator subscribers directory" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   206
			@listpath.should_receive( :+ ).with( 'mod/subscribers' ).and_return( subscribers_dir )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   207
			subscribers_dir.should_receive( :+ ).with( '*' ).and_return( :mod_sub_dir )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   208
			expectation = Pathname.should_receive( :glob ).with( :mod_sub_dir )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   209
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   210
			TEST_MODERATORS.each do |email|
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   211
				mock_subfile = mock( "Mock subscribers file for '#{email}'" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   212
				mock_subfile.should_receive( :read ).and_return( "T#{email}\0" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   213
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   214
				expectation.and_yield( mock_subfile )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   215
			end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   216
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   217
			mods = @list.subscription_moderators
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   218
			mods.should have(TEST_MODERATORS.length).members
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   219
			mods.should include( *TEST_MODERATORS )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   220
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   221
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   222
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   223
		it "can return a list of subscription moderators' email addresses when the moderators " +
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   224
		   "directory has been customized" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   225
			# Test the moderation config files for existence
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   226
			modsub_path_obj = mock( "Mock 'modsub' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   227
			@listpath.should_receive( :+ ).with( 'modsub' ).twice.and_return( modsub_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   228
			modsub_path_obj.should_receive( :exist? ).twice.and_return( true )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   229
			@listpath.should_receive( :+ ).with( 'remote' )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   230
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   231
			# Try to read directory names from both config files
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   232
			modsub_path_obj.should_receive( :read ).with( 1 ).and_return( '/' )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   233
			modsub_path_obj.should_receive( :read ).with().and_return( TEST_CUSTOM_MODERATORS_DIR )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   234
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   235
			custom_mod_path = mock( "Mock path object for customized moderator dir" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   236
			Pathname.should_receive( :new ).with( TEST_CUSTOM_MODERATORS_DIR ).and_return( custom_mod_path )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   237
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   238
			# Read subscribers from the default file
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   239
			custom_mod_path.should_receive( :+ ).with( '*' ).and_return( :mod_sub_dir )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   240
			expectation = Pathname.should_receive( :glob ).with( :mod_sub_dir )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   241
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   242
			TEST_MODERATORS.each do |email|
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   243
				mock_subfile = mock( "Mock subscribers file for '#{email}'" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   244
				mock_subfile.should_receive( :read ).and_return( "T#{email}\0" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   245
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   246
				expectation.and_yield( mock_subfile )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   247
			end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   248
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   249
			mods = @list.subscription_moderators
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   250
			mods.should have(TEST_MODERATORS.length).members
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   251
			mods.should include( *TEST_MODERATORS )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   252
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   253
		
3
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   254
		it "can get a list of modererators when remote subscription moderation is enabled" +
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   255
           " and the modsub configuration is empty" do
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   256
			# Test the moderation config files for existence
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   257
			modsub_path_obj = mock( "Mock 'modsub' path object" )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   258
			@listpath.should_receive( :+ ).with( 'modsub' ).twice.and_return( modsub_path_obj )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   259
			modsub_path_obj.should_receive( :exist? ).twice.and_return( false )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   260
            remote_path_obj = mock( "Mock 'remote' path object" )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   261
			@listpath.should_receive( :+ ).with( 'remote' ).twice.and_return( remote_path_obj )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   262
            remote_path_obj.should_receive( :exist? ).twice.and_return( true )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   263
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   264
			# Try to read directory names from both config files
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   265
			remote_path_obj.should_receive( :read ).with( 1 ).and_return( '/' )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   266
			remote_path_obj.should_receive( :read ).with().and_return( TEST_CUSTOM_MODERATORS_DIR )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   267
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   268
			custom_mod_path = mock( "Mock path object for customized moderator dir" )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   269
			Pathname.should_receive( :new ).with( TEST_CUSTOM_MODERATORS_DIR ).and_return( custom_mod_path )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   270
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   271
			# Read subscribers from the default file
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   272
			custom_mod_path.should_receive( :+ ).with( '*' ).and_return( :mod_sub_dir )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   273
			expectation = Pathname.should_receive( :glob ).with( :mod_sub_dir )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   274
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   275
			TEST_MODERATORS.each do |email|
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   276
				mock_subfile = mock( "Mock subscribers file for '#{email}'" )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   277
				mock_subfile.should_receive( :read ).and_return( "T#{email}\0" )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   278
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   279
				expectation.and_yield( mock_subfile )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   280
			end
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   281
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   282
			mods = @list.subscription_moderators
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   283
			mods.should have(TEST_MODERATORS.length).members
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   284
			mods.should include( *TEST_MODERATORS )
9b9e85ccf4f9 Add a test for a customized moderator's directory in the dir/remote file.
Michael Granger <mgranger@laika.com>
parents: 2
diff changeset
   285
		end
2
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   286
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   287
		### Message moderation
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   288
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   289
		it "knows that subscription moderation is enabled if the dir/modpost file exists" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   290
			modpost_path_obj = mock( "Mock 'modpost' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   291
			@listpath.should_receive( :+ ).with( 'modpost' ).and_return( modpost_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   292
			modpost_path_obj.should_receive( :exist? ).and_return( true )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   293
			
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   294
			@list.should be_moderated()
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   295
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   296
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   297
		it "knows that subscription moderation is disabled if the dir/modpost file doesn't exist" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   298
			modpost_path_obj = mock( "Mock 'modpost' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   299
			@listpath.should_receive( :+ ).with( 'modpost' ).and_return( modpost_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   300
			modpost_path_obj.should_receive( :exist? ).and_return( false )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   301
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   302
			@list.should_not be_moderated()
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   303
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   304
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   305
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   306
		it "returns an empty array of message moderators for an open list" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   307
			modpost_path_obj = mock( "Mock 'modpost' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   308
			@listpath.should_receive( :+ ).with( 'modpost' ).and_return( modpost_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   309
			modpost_path_obj.should_receive( :exist? ).and_return( false )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   310
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   311
			@list.message_moderators.should be_empty()
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   312
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   313
	
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   314
	
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   315
		it "can return a list of message moderators' email addresses" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   316
			# Test the moderation config file for existence
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   317
			modpost_path_obj = mock( "Mock 'modpost' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   318
			@listpath.should_receive( :+ ).with( 'modpost' ).twice.and_return( modpost_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   319
			modpost_path_obj.should_receive( :exist? ).twice.and_return( true )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   320
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   321
			# Try to read directory names from the config file
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   322
			modpost_path_obj.should_receive( :read ).with( 1 ).and_return( nil )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   323
			
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   324
			# Read subscribers from the default directory
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   325
			subscribers_dir = mock( "Mock moderator subscribers directory" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   326
			@listpath.should_receive( :+ ).with( 'mod/subscribers' ).and_return( subscribers_dir )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   327
			subscribers_dir.should_receive( :+ ).with( '*' ).and_return( :mod_sub_dir )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   328
			expectation = Pathname.should_receive( :glob ).with( :mod_sub_dir )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   329
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   330
			TEST_MODERATORS.each do |email|
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   331
				mock_subfile = mock( "Mock subscribers file for '#{email}'" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   332
				mock_subfile.should_receive( :read ).and_return( "T#{email}\0" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   333
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   334
				expectation.and_yield( mock_subfile )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   335
			end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   336
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   337
			mods = @list.message_moderators
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   338
			mods.should have(TEST_MODERATORS.length).members
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   339
			mods.should include( *TEST_MODERATORS )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   340
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   341
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   342
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   343
		it "can return a list of message moderators' email addresses when the moderators " +
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   344
		   "directory has been customized" do
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   345
			# Test the moderation config files for existence
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   346
			modpost_path_obj = mock( "Mock 'modpost' path object" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   347
			@listpath.should_receive( :+ ).with( 'modpost' ).twice.and_return( modpost_path_obj )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   348
			modpost_path_obj.should_receive( :exist? ).twice.and_return( true )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   349
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   350
			# Try to read directory names from both config files
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   351
			modpost_path_obj.should_receive( :read ).with( 1 ).and_return( '/' )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   352
			modpost_path_obj.should_receive( :read ).with().and_return( TEST_CUSTOM_MODERATORS_DIR )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   353
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   354
			custom_mod_path = mock( "Mock path object for customized moderator dir" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   355
			Pathname.should_receive( :new ).with( TEST_CUSTOM_MODERATORS_DIR ).and_return( custom_mod_path )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   356
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   357
			# Read subscribers from the default file
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   358
			custom_mod_path.should_receive( :+ ).with( '*' ).and_return( :mod_sub_dir )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   359
			expectation = Pathname.should_receive( :glob ).with( :mod_sub_dir )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   360
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   361
			TEST_MODERATORS.each do |email|
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   362
				mock_subfile = mock( "Mock subscribers file for '#{email}'" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   363
				mock_subfile.should_receive( :read ).and_return( "T#{email}\0" )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   364
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   365
				expectation.and_yield( mock_subfile )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   366
			end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   367
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   368
			mods = @list.message_moderators
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   369
			mods.should have(TEST_MODERATORS.length).members
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   370
			mods.should include( *TEST_MODERATORS )
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   371
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   372
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   373
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   374
		### List owner
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   375
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   376
		it "returns nil when the list doesn't have an owner in its config" do
5
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   377
			@list.stub!( :config ).and_return({ '5' => nil })
2
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   378
			@list.owner.should == nil
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   379
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   380
		
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   381
			
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   382
		it "can return the email address of the list owner" do
5
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   383
			@list.stub!( :config ).and_return({ '5' => TEST_OWNER })
2
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   384
			@list.owner.should == TEST_OWNER
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   385
		end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   386
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   387
	end
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   388
	
5
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   389
	
2
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   390
	### 
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   391
	### Archive functions
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   392
	### 
4
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   393
	describe "archive functions" do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   394
	
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   395
		before( :each ) do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   396
			@listpath = LISTDIR.dup
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   397
			@list = Ezmlm::List.new( @listpath )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   398
		end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   399
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   400
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   401
		it "can return the count of archived posts" do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   402
			numpath_obj = mock( "num file path object" )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   403
			@listpath.should_receive( :+ ).with( 'num' ).and_return( numpath_obj )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   404
			
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   405
			numpath_obj.should_receive( :exist? ).and_return( true )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   406
			numpath_obj.should_receive( :read ).and_return( "1723:123123123" )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   407
			
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   408
			@list.message_count.should == 1723
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   409
		end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   410
	
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   411
		it "can return the count of archived posts to a list that hasn't been posted to" do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   412
			numpath_obj = mock( "num file path object" )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   413
			@listpath.should_receive( :+ ).with( 'num' ).and_return( numpath_obj )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   414
			
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   415
			numpath_obj.should_receive( :exist? ).and_return( false )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   416
			
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   417
			@list.message_count.should == 0
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   418
		end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   419
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   420
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   421
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   422
		TEST_ARCHIVE_DIR = LISTDIR + 'archive'
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   423
		TEST_ARCHIVE_SUBDIRS = %w[ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 ]
5
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   424
		TEST_POST_FILES = %w[ 00 01 02 03 04 05 06 07 08 09 10 11 12 13 ]
4
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   425
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   426
		before( :each ) do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   427
			@archive_dir = TEST_ARCHIVE_DIR.dup
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   428
			@archive_subdirs = TEST_ARCHIVE_SUBDIRS.dup
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   429
			@archive_subdir_paths = TEST_ARCHIVE_SUBDIRS.collect {|pn| TEST_ARCHIVE_DIR + pn }
5
804e1c2b9a40 * Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents: 4
diff changeset
   430
			@archive_post_paths = TEST_POST_FILES.collect {|pn|
4
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   431
				TEST_ARCHIVE_DIR + TEST_ARCHIVE_SUBDIRS.last + pn
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   432
			  }
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   433
		end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   434
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   435
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   436
		it "can return a TMail::Mail object parsed from the last archived post" do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   437
			# need to find the last message
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   438
			archive_path_obj = mock( "archive path" )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   439
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   440
			@listpath.should_receive( :+ ).with( 'archive' ).and_return( archive_path_obj )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   441
			archive_path_obj.should_receive( :exist? ).and_return( true )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   442
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   443
			# Find the last numbered directory under the archive dir
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   444
			archive_path_obj.should_receive( :+ ).with( '[0-9]*' ).
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   445
				and_return( :archive_dir_globpath )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   446
			Pathname.should_receive( :glob ).with( :archive_dir_globpath ).
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   447
				and_return( @archive_subdir_paths )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   448
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   449
			# Find the last numbered file under the last numbered directory we found
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   450
			# above.
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   451
			@archive_subdir_paths.last.should_receive( :+ ).with( '[0-9]*' ).
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   452
				and_return( :archive_post_pathglob )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   453
			Pathname.should_receive( :glob ).with( :archive_post_pathglob ).
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   454
				and_return( @archive_post_paths )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   455
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   456
			TMail::Mail.should_receive( :load ).with( @archive_post_paths.last.to_s ).
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   457
				and_return( :mail_object )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   458
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   459
			@list.last_post.should == :mail_object
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   460
		end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   461
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   462
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   463
		it "returns nil for the last post if there is no archive directory for the list" do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   464
			archive_path_obj = mock( "archive path" )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   465
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   466
			@listpath.should_receive( :+ ).with( 'archive' ).and_return( archive_path_obj )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   467
			archive_path_obj.should_receive( :exist? ).and_return( false )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   468
			@list.last_post.should == nil
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   469
		end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   470
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   471
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   472
		it "returns nil for the last post if there haven't been any posts to the list" do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   473
			archive_path_obj = mock( "archive path" )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   474
			mail_object = mock( "Mock TMail object" )
2
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   475
4
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   476
			@listpath.should_receive( :+ ).with( 'archive' ).and_return( archive_path_obj )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   477
			archive_path_obj.should_receive( :exist? ).and_return( true )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   478
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   479
			# Find the last numbered directory under the archive dir
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   480
			archive_path_obj.should_receive( :+ ).with( '[0-9]*' ).
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   481
				and_return( :archive_dir_globpath )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   482
			Pathname.should_receive( :glob ).with( :archive_dir_globpath ).and_return( [] )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   483
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   484
			@list.last_post.should == nil
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   485
		end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   486
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   487
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   488
		it "raises a RuntimeError if the last archive directory doesn't have any messages in it" do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   489
			archive_path_obj = mock( "archive path" )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   490
			mail_object = mock( "Mock TMail object" )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   491
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   492
			@listpath.should_receive( :+ ).with( 'archive' ).and_return( archive_path_obj )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   493
			archive_path_obj.should_receive( :exist? ).and_return( true )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   494
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   495
			# Find the last numbered directory under the archive dir
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   496
			archive_path_obj.should_receive( :+ ).with( '[0-9]*' ).
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   497
				and_return( :archive_dir_globpath )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   498
			Pathname.should_receive( :glob ).with( :archive_dir_globpath ).
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   499
				and_return( @archive_subdir_paths )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   500
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   501
			@archive_subdir_paths.last.should_receive( :+ ).with( '[0-9]*' ).
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   502
				and_return( :archive_post_pathglob )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   503
			Pathname.should_receive( :glob ).with( :archive_post_pathglob ).
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   504
				and_return( [] )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   505
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   506
			lambda {
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   507
				@list.last_post
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   508
			}.should raise_error( RuntimeError, /unexpectedly empty/i )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   509
		end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   510
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   511
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   512
		it "can fetch the date of the last archived post" do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   513
			mail_object = mock( "Mock TMail object" )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   514
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   515
			@list.should_receive( :last_post ).and_return( mail_object )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   516
			mail_object.should_receive( :date ).and_return( :the_message_date )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   517
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   518
			@list.last_message_date.should == :the_message_date
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   519
		end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   520
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   521
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   522
		it "can fetch the date of the last archived post" do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   523
			mail_object = mock( "Mock TMail object" )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   524
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   525
			@list.should_receive( :last_post ).and_return( mail_object )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   526
			mail_object.should_receive( :date ).and_return( :the_message_date )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   527
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   528
			@list.last_message_date.should == :the_message_date
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   529
		end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   530
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   531
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   532
		it "can fetch the author of the last archived post" do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   533
			mail_object = mock( "Mock TMail object" )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   534
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   535
			@list.should_receive( :last_post ).and_return( mail_object )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   536
			mail_object.should_receive( :from ).and_return( :the_message_author )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   537
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   538
			@list.last_message_author.should == :the_message_author
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   539
		end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   540
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   541
		
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   542
		it "can fetch the subject of the last archived post" do
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   543
			mail_object = mock( "Mock TMail object" )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   544
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   545
			@list.should_receive( :last_post ).and_return( mail_object )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   546
			mail_object.should_receive( :from ).and_return( :the_message_author )
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   547
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   548
			@list.last_message_author.should == :the_message_author
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   549
		end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   550
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   551
	end
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   552
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   553
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   554
	it "can fetch the body of an archived post by message id"
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   555
	it "can fetch the header of an archived post by message id"
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   556
	
8c4ae0797d5f Added more archive-related functions:
Michael Granger <mgranger@laika.com>
parents: 3
diff changeset
   557
	it "can return a hash of the subjects of all archived posts to message ids" 
2
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   558
	it "can return an Array of the subjects of all archived posts"
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   559
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   560
	it "can return a hash of the threads of all archived posts to message ids"
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   561
	it "can return an Array of the threads of all archived posts"
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   562
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   563
	it "can return a hash of the authors of all archived posts to message ids"
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   564
	it "can return an Array of the authors of all archived posts"
7b5a0131d5cd Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents: 1
diff changeset
   565
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
   566
end
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
   567
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
   568