There are some tests in test/ directory, however all tests include same part below:
begin
$stderr.puts RUBY_DESCRIPTION
pid = fork do
trap(:INT) { Bossan.stop }
Bossan.listen(DEFAULT_HOST, DEFAULT_PORT)
Bossan.run(App.new)
end
Process.detach pid
unless server_is_wake_up?
$stderr.puts "bossan won't wake up until you love it ..."
exit 1
end
err = MiniTest::Unit.new.run(ARGV)
exit false if err && err != 0
ensure
Process.kill(:INT, pid)
end
This patch refactors tests, it moves that codes to test/bossan_test.rb
We can use Bossan::Test::TestCase instead of Test::Unit::TestCase. It automatically starts/stops server each tests.
And, add test endpoint test/driver.rb, so rake test simply kick it.
There are some tests in test/ directory, however all tests include same part below:
This patch refactors tests, it moves that codes to test/bossan_test.rb We can use Bossan::Test::TestCase instead of Test::Unit::TestCase. It automatically starts/stops server each tests.
And, add test endpoint test/driver.rb, so
rake test
simply kick it.