Changeset 5276 for platform/tdiary/spec

Show
Ignore:
Timestamp:
01/22/08 16:38:54 (10 months ago)
Author:
hsbt
Message:

platform/tdiary/spec/spec_helper.rb: add anchor method, and @date

Files:
1 modified

Legend:

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

    r5171 r5276  
    77 
    88        attr_reader :conf 
    9         attr_accessor :mode 
     9        attr_accessor :mode, :date 
    1010 
    1111        def initialize 
    1212                @conf = Config.new 
    1313                @mode = "" 
     14                @date = nil 
    1415                @header_procs = [] 
    1516        end 
     
    6061        end 
    6162end 
     63 
    6264def fake_plugin( name_sym, base=nil, &block ) 
    6365        plugin = PluginFake.new 
     
    8587        File.expand_path( File.join( paths )) 
    8688end 
     89 
     90def anchor( s ) 
     91        if /^([\-\d]+)#?([pct]\d*)?$/ =~ s then 
     92                if $2 then 
     93                        "?date=#$1##$2" 
     94                else 
     95                        "?date=#$1" 
     96                end 
     97        else 
     98                "" 
     99        end 
     100end