-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.rb
38 lines (28 loc) · 739 Bytes
/
env.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require 'aruba/cucumber'
allup_dir = File.expand_path('../../../', __FILE__)
raise 'allup build failed' unless system('GOPATH=`pwd` go build -o allup main')
require 'httparty'
def is_running(url)
begin
HTTParty.get(url)
return true
rescue Errno::ECONNREFUSED
return false
end
end
def is_netlocal_running
is_running("http://localhost:9999")
end
if !is_netlocal_running
puts "Netlocal is not running. Please start it on localhost:9999"
print "Waiting for you to start netlocal..."
while !is_netlocal_running
sleep 1
print "."
end
puts
end
fail "===> CouchDB must not be running on port 5984" if is_running("http://localhost:5984")
Before do
set_env 'PATH', "#{allup_dir}:#{ENV['PATH']}"
end