リビジョン | d824121a40ba9b54fd0737339cc234cf84d09643 (tree) |
---|---|
日時 | 2016-05-05 14:30:58 |
作者 | Shyouzou Sugitani <shy@user...> |
コミッター | Shyouzou Sugitani |
update tests(8)
@@ -1,21 +1,19 @@ | ||
1 | -require "ninix/update" | |
1 | +require_relative "../lib/ninix/update" | |
2 | 2 | |
3 | 3 | module NinixTest |
4 | 4 | |
5 | 5 | class UpdateTest |
6 | 6 | |
7 | - def initialize | |
7 | + def initialize(ghostdir, homeurl) | |
8 | 8 | update = Update::NetworkUpdate.new |
9 | 9 | update.set_responsible(self) |
10 | - homeurl = "http://www.aquadrop.sakura.ne.jp/shizuku/" | |
11 | - ghostdir = "/home/shy/TEST/ghost/shizuku" | |
12 | - update.start(homeurl, ghostdir, timeout=60) | |
10 | + update.start(homeurl, ghostdir, :timeout => 60) | |
13 | 11 | while true |
14 | 12 | state = update.state |
15 | 13 | s = Time.now.to_i |
16 | 14 | code = update.run() |
17 | 15 | e = Time.now.to_i |
18 | - delta = e - s | |
16 | + delta = (e - s) | |
19 | 17 | if delta > 0.1 |
20 | 18 | print('Warning: state = ', state.to_i, ' (', delta.to_f, ' sec)', "\n") |
21 | 19 | end |
@@ -46,4 +44,10 @@ module NinixTest | ||
46 | 44 | end |
47 | 45 | end |
48 | 46 | |
49 | -NinixTest::UpdateTest.new | |
47 | +#homeurl = "http://aquadrop.sakura.ne.jp/ghost/shizuku/" | |
48 | +#ghostdir = "/home/shy/TEST/ghost/shizuku" | |
49 | +homeurl = "http://unvollendet.hp.infoseek.co.jp/ukagaka/kousin2/" | |
50 | +ghostdir = "home/shy/TEST/ghost/Taromati" | |
51 | +#homeurl = "http://rking.x0.com/ukagaka_up/bth5/" | |
52 | +#ghostdir = "home/shy/TEST/ghost/BTHver.5" | |
53 | +NinixTest::UpdateTest.new(ghostdir, homeurl) |