Changeset 12243 for platform/tdiary/spec

Show
Ignore:
Timestamp:
05/23/08 17:10:36 (6 months ago)
Author:
hiraku
Message:

Fix "@account_ad_list => nil" in add_conf_proc.

Location:
platform/tdiary/spec
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • platform/tdiary/spec/account_ad_spec.rb

    r5345 r12243  
    4646                                        :name => 'hsbt')} 
    4747                end 
     48 
     49                describe "in configuration mode" do 
     50                        before do 
     51                                @plugin = setup_account_ad_plugin('Hatena', 'hsbt', 'conf') 
     52                        end 
     53 
     54                         
     55                        it "should not raise error" do 
     56                                lambda{@plugin.conf_proc}.should_not raise_error 
     57                        end 
     58                end 
    4859        end 
    4960 
  • platform/tdiary/spec/spec_helper.rb

    r6812 r12243  
    1919                @footer_procs = [] 
    2020                @update_procs = [] 
     21                @conf_procs = [] 
    2122                @body_enter_procs = [] 
    2223                @body_leave_procs = [] 
     
    2425 
    2526        def add_conf_proc( key, label, genre=nil, &block ) 
    26                 # XXX Do we need to verify add_* called?? 
     27                @conf_procs << block 
    2728        end 
    2829 
     
    3738        def add_update_proc( block = Proc::new ) 
    3839                @update_procs << block 
     40        end 
     41 
     42        def conf_proc 
     43                r = [] 
     44                @conf_procs.each do |proc| 
     45                        r << proc.call 
     46                end 
     47                r.join.chomp 
    3948        end 
    4049