Changeset 5302 for platform/tdiary/spec
- Timestamp:
- 01/23/08 00:11:00 (11 months ago)
- Files:
-
- 1 moved
-
platform/tdiary/spec/my_hotentry_spec.rb (moved) (moved from platform/tdiary/test/my_hotentry_spec.rb) (5 diffs)
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'5 1 require 'tmpdir' 6 2 require 'fileutils' 7 3 begin 8 $:.unshift(File.join(File.dirname(__FILE__), "..", "plugin"))9 4 require 'my_hotentry' 10 5 rescue … … 13 8 describe "MyHotEntry" do 14 9 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__)}-#{$$}") 17 12 Dir.mkdir(@cache_path) 18 13 @dbfile = "#{@cache_path}/my_hotentry.dat" … … 24 19 25 20 it "update" do 26 # �͵���������� base_url = 'http://d.hatena.ne.jp/' 21 # 人気の日記一覧を取得する 22 base_url = 'http://d.hatena.ne.jp/' 27 23 hotentry = MyHotEntry.new(@dbfile) 28 24 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 31 29 entries.size.should > 0 32 30 entries.each do |entry| … … 36 34 end 37 35 38 # ���������Ƥ⥭�����奵������������ʤ������� it "double update" do 36 # 何度も取得してもキャッシュサイズが大きくならないこと 37 it "double update" do 39 38 base_url = 'http://d.hatena.ne.jp/' 40 39 hotentry = MyHotEntry.new(@dbfile) … … 48 47 end 49 48 50 # ����������ϥ����������ꥢ���ʤ�49 # 取得結果が空の場合はキャッシュをクリアしない 51 50 it "update noentry" do 52 51 exist_url = 'http://d.hatena.ne.jp/'
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)