LoginSignup
0
0

More than 5 years have passed since last update.

ぱっとタイムアウトテスト用 Web サーバを立てる

Posted at

ぱっとタイムアウトテスト用 Web サーバを立てる

タイムアウトテスト用 Web サーバを irb で.

require 'webrick'
s = WEBrick::HTTPServer.new(:Port => 8000)
s.mount_proc('/') {|req, res|
  sleep 300
  res['Content-Type'] = 'text/plain'
  res.body = '300 secs passed'
}
trap(:INT){s.shutdown}
s.start

irb に流し込んだ後は http://localhost:8000/ にアクセスすれば OK.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0