Module: Castanet::Testing::CommonTasks
Constant Summary
Castanet::Testing::ConnectionTesting::LOGGER
Instance Method Summary
collapse
#responding?
Instance Method Details
#clean_all(scratch_dir, prefix) ⇒ Object
23
24
25
26
27
|
# File 'lib/castanet/testing/common_tasks.rb', line 23
def clean_all(scratch_dir, prefix)
files = FileList["#{scratch_dir}/#{prefix}.*"]
rm_rf files unless files.empty?
end
|
#wait_all(scratch_dir, timeout) ⇒ Object
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/castanet/testing/common_tasks.rb', line 12
def wait_all(scratch_dir, timeout)
Timeout.timeout(timeout) do
loop do
urls = Dir["#{scratch_dir}/**/.urls"].map { |x| JSON.parse(File.read(x))['status'] }
urls.reject! { |u| responding?(u) }
break true if urls.empty?
sleep 1
end
end
end
|