From 2594fa44b56ec3b0993cee05c6467a7da77a3060 Mon Sep 17 00:00:00 2001 From: SHIMADA Koji Date: Wed, 10 Aug 2011 16:53:23 +0900 Subject: [PATCH] fix TestActArchive#test_act_zip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mtime による検証だと page の返す mtime と Zip::ZipEntry が返す mtime とで差が出てしまいテストに失敗するケースがあるため、 コンテンツの内容による検証に変更 --- lib/qwik/act-archive.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/qwik/act-archive.rb b/lib/qwik/act-archive.rb index cba44fb..e7ce5af 100644 --- a/lib/qwik/act-archive.rb +++ b/lib/qwik/act-archive.rb @@ -220,18 +220,18 @@ def test_act_zip page.store '* ' page = @site.create_new - page.store '* A Presentation Page + page_contents = '* A Presentation Page {{presen}} * Header 2 ' - mtime = {} - mtime[page.key] = page.mtime - - sleep(1) # let mtime be odd value + page.store page_contents + contents = {} + contents[page.key] = page_contents page = @site.create('PresenTest') - page.store '* A presentation test page' - mtime[page.key] = page.mtime + page_content = '* A presentation test page' + page.store page_content + contents[page.key] = page_content res = session '/test/test.zip' ok_title "Start." @@ -307,9 +307,9 @@ def test_act_zip Zip::ZipInputStream.open('testtemp.zip') {|zis| while e = zis.get_next_entry e_name = File.basename(e.name,'.txt') - if mtime.has_key? e_name - expected = mtime[e_name].to_i / 2 * 2 - actual = e.time.to_i / 2 * 2 + if contents.has_key? e_name + expected = contents[e_name] + actual = e.get_input_stream {|f| f.read } ok_eq(expected, actual) end end