public
Description: Tumblebot that feeds ni.hili.st. Plays well with Autumn Leaves.
Homepage: http://ni.hili.st/post/20314520
Clone URL: git://github.com/flogic/nihilist_bot.git
Search Repo:
Normalizing the address-requiring channel names.
ymendel (author)
Wed Jun 25 21:47:29 -0700 2008
commit  caf0232943e3fdb26731943cd28d51fba541ae92
tree    e3e829a92702a0f4d75fe79684b961fc51cd3905
parent  4c3c7b9159c4654bb9e993e482dcc86086a6f54c
...
60
61
62
63
 
64
65
...
60
61
62
 
63
64
65
0
@@ -60,6 +60,6 @@ class Bot < AutumnLeaf
0
   end
0
   
0
   def address_required_channels
0
- options[:address_required_channels] || []
0
+ (options[:address_required_channels] || []).collect { |channel| normalized_channel_name(channel) }
0
   end
0
 end
...
197
198
199
200
201
 
 
 
 
 
 
 
202
203
204
...
197
198
199
 
 
200
201
202
203
204
205
206
207
208
209
0
@@ -197,8 +197,13 @@ describe Bot, 'getting the address-required channels' do
0
   end
0
   
0
   it 'should return the channels marked as requiring addressing in the configuration' do
0
- @bot.stubs(:options).returns({ :address_required_channels => %w[4chan 2chan redchan bluechan] })
0
- @bot.address_required_channels.should == %w[4chan 2chan redchan bluechan]
0
+ @bot.stubs(:options).returns({ :address_required_channels => %w[#4chan #2chan #redchan #bluechan] })
0
+ @bot.address_required_channels.should == %w[#4chan #2chan #redchan #bluechan]
0
+ end
0
+
0
+ it 'should ensure the channels have normalized names' do
0
+ @bot.stubs(:options).returns({ :address_required_channels => %w[#4chan &2chan +redchan !bluechan upchan downchan] })
0
+ @bot.address_required_channels.should == %w[#4chan &2chan +redchan !bluechan #upchan #downchan]
0
   end
0
   
0
   it 'should return an empty array if the configuration has no channels requiring addressing' do

Comments

    No one has commented yet.