Sha256: a01d235607439629613ded2785b625df4f4e4f9ab4bdaac9893134a732bb7be2

Contents?: true

Size: 720 Bytes

Versions: 2

Compression:

Stored size: 720 Bytes

Contents

#!/usr/bin/env ruby
# -*- coding: binary -*-

$:.unshift(File.join(File.dirname(__FILE__), '..'))

require 'test/unit'
require 'rex/service_manager'

class Rex::ServiceManager::UnitTest < Test::Unit::TestCase

	Klass = Rex::ServiceManager

	def test_svcm
		begin
			c = Klass
			s = c.start(Rex::Proto::Http::Server, 8090)
			assert_not_nil(s)
			t = c.start(Rex::Proto::Http::Server, 8090)
			assert_not_nil(t)
			assert_equal(s, t)
			z = c.start(Rex::Proto::Http::Server, 8091)
			assert_not_equal(t, z)
			assert_equal("HTTP Server", s.alias)
			assert_equal("HTTP Server 1", z.alias)
		ensure
			c.stop_by_alias(s.alias) if (s)
			c.stop_by_alias(z.alias) if (z)
			c.stop_by_alias(t.alias) if (t)
		end

	end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
librex-0.0.68 lib/rex/service_manager.rb.ut.rb
librex-0.0.66 lib/rex/service_manager.rb.ut.rb