test/landrush/server_test.rb in landrush-1.2.0 vs test/landrush/server_test.rb in landrush-1.3.0
- old
+ new
@@ -12,33 +12,22 @@
end
end
def wait_for_port
sleep 1 until begin
- TCPSocket.open('127.0.0.1', Server.port)
- rescue
- nil
- end
+ TCPSocket.open('127.0.0.1', Server.port)
+ rescue StandardError
+ nil
+ end
end
- before do
- @tmp_dir = Dir.mktmpdir('landrush-server-test-')
- Server.working_dir = @tmp_dir
- Server.gems_dir = gem_dir
- end
-
- after do
- Server.stop
- FileUtils.rm_rf(@tmp_dir) if File.exist?(@tmp_dir)
- end
-
describe 'start/stop' do
it 'starts and stops a daemon' do
Server.start
- Server.running?.must_equal true
+ Server.status.must_equal :running
Server.stop
- Server.running?.must_equal false
+ Server.status.must_equal :stopped
end
# FIXME: This test requires network access.
# Which is not airplane hacking friendly. >:p
it 'can be queried for upstream entries' do