lib/sinatra/runner.rb in sinatra-contrib-2.0.0 vs lib/sinatra/runner.rb in sinatra-contrib-2.0.1.rc1
- old
+ new
@@ -1,53 +1,53 @@
require 'open-uri'
require 'net/http'
require 'timeout'
-# NOTE: This feature is experimental, and missing tests!
-#
-# Helps you spinning up and shutting down your own sinatra app. This is especially helpful for running
-# real network tests against a sinatra backend.
-#
-# The backend server could look like the following (in test/server.rb).
-#
-# require "sinatra"
-#
-# get "/" do
-# "Cheers from test server"
-# end
-#
-# get "/ping" do
-# "1"
-# end
-#
-# Note that you need to implement a ping action for internal use.
-#
-# Next, you need to write your runner.
-#
-# require 'sinatra/runner'
-#
-# class Runner < Sinatra::Runner
-# def app_file
-# File.expand_path("../server.rb", __FILE__)
-# end
-# end
-#
-# Override Runner#app_file, #command, #port, #protocol and #ping_path for customization.
-#
-# **Don't forget to override #app_file specific to your application!**
-#
-# Whereever you need this test backend, here's how you manage it. The following example assumes you
-# have a test in your app that needs to be run against your test backend.
-#
-# runner = ServerRunner.new
-# runner.run
-#
-# # ..tests against localhost:4567 here..
-#
-# runner.kill
-#
-# For an example, check https://github.com/apotonick/roar/blob/master/test/integration/runner.rb
module Sinatra
+ # NOTE: This feature is experimental, and missing tests!
+ #
+ # Helps you spinning up and shutting down your own sinatra app. This is especially helpful for running
+ # real network tests against a sinatra backend.
+ #
+ # The backend server could look like the following (in test/server.rb).
+ #
+ # require "sinatra"
+ #
+ # get "/" do
+ # "Cheers from test server"
+ # end
+ #
+ # get "/ping" do
+ # "1"
+ # end
+ #
+ # Note that you need to implement a ping action for internal use.
+ #
+ # Next, you need to write your runner.
+ #
+ # require 'sinatra/runner'
+ #
+ # class Runner < Sinatra::Runner
+ # def app_file
+ # File.expand_path("../server.rb", __FILE__)
+ # end
+ # end
+ #
+ # Override Runner#app_file, #command, #port, #protocol and #ping_path for customization.
+ #
+ # **Don't forget to override #app_file specific to your application!**
+ #
+ # Wherever you need this test backend, here's how you manage it. The following example assumes you
+ # have a test in your app that needs to be run against your test backend.
+ #
+ # runner = ServerRunner.new
+ # runner.run
+ #
+ # # ..tests against localhost:4567 here..
+ #
+ # runner.kill
+ #
+ # For an example, check https://github.com/apotonick/roar/blob/master/test/integration/runner.rb
class Runner
def app_file
File.expand_path("../server.rb", __FILE__)
end