Changeset 5302 for platform/tdiary/spec

Show
Ignore:
Timestamp:
01/23/08 00:11:00 (11 months ago)
Author:
kakutani
Message:

platform/tdiary/test/my_hotentry_spec.rb, platform/tdiary/spec/my_hotentry_spec.rb: move from test/ to spec/

Files:
1 moved

Legend:

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

    r5301 r5302  
    1 $KCODE = 'e' 
    2 require 'rubygems' 
    3 gem 'rspec' 
    4 require 'spec' 
    51require 'tmpdir' 
    62require 'fileutils' 
    73begin 
    8         $:.unshift(File.join(File.dirname(__FILE__), "..", "plugin")) 
    94  require 'my_hotentry' 
    105rescue 
     
    138describe "MyHotEntry" do 
    149        before do 
    15                 # @cache_path �ϡ֥ե�����-�ץ����� 
    16                 @cache_path = File.join(Dir.tmpdir, "#{__FILE__}-#{$$}") 
     10                # @cache_path は「ファイル名-プロセス番号」 
     11                @cache_path = File.join(Dir.tmpdir, "#{File.basename(__FILE__)}-#{$$}") 
    1712                Dir.mkdir(@cache_path) 
    1813                @dbfile = "#{@cache_path}/my_hotentry.dat" 
     
    2419 
    2520        it "update" do 
    26                 # �͵����������  base_url = 'http://d.hatena.ne.jp/' 
     21                # 人気の日記一覧を取得する 
     22                base_url = 'http://d.hatena.ne.jp/' 
    2723                hotentry = MyHotEntry.new(@dbfile) 
    2824                hotentry.update(base_url) 
    29                 # �������������뤬���������뤳��            File.file?(@dbfile).should be_true 
    30                 # �͵������Ǥ��Ƥ��뤳��             entries = hotentry.entries 
     25                # キャッシュファイルが生成されていること 
     26                File.file?(@dbfile).should be_true 
     27                # 人気の日記が取得できていること 
     28                entries = hotentry.entries 
    3129                entries.size.should > 0 
    3230                entries.each do |entry| 
     
    3634        end 
    3735 
    38         # ���������Ƥ⥭�����奵������������ʤ������� it "double update" do 
     36        # 何度も取得してもキャッシュサイズが大きくならないこと 
     37        it "double update" do 
    3938                base_url = 'http://d.hatena.ne.jp/' 
    4039                hotentry = MyHotEntry.new(@dbfile) 
     
    4847        end 
    4948 
    50         # ����������ϥ����������ꥢ���ʤ� 
     49        # 取得結果が空の場合はキャッシュをクリアしない 
    5150        it "update noentry" do 
    5251                exist_url = 'http://d.hatena.ne.jp/'