lib/grape_ape/test_helper.rb
# Launches an instance of a given API server. The server
# will launch on the specified port.
#
# @param api [Class] The API class to launch
# @param port [Integer] The port to run the server on
# @param options [Hash] The options hash to provide to the server
# @return [Goliath::Server] The executed server
Launches an instance of a given API server. The server
will launch on the specified port.
Launches an instance of a given API server . The server will launch on the specified port .
def server(api, port, options = {}, &blk)
      op = OptionParser.new
      s = GrapeApe::Goliath::Server.new
      s.logger = setup_logger(options)
      s.api = api
      s.app = ::Goliath::Rack::Builder.build(api.class, s.api)
      s.api.options_parser(op, options)
      s.options = options
      s.port = port
      s.plugins = api.class.plugins
      @test_server_port = s.port if blk
      s.start(&blk)
      s
    end
def server ( api , port , options = { } , & blk ) op = OptionParser . new s = GrapeApe :: Goliath :: Server . new s . logger = setup_logger ( options ) s . api = api s . app = :: Goliath :: Rack :: Builder . build ( api . class , s . api ) s . api . options_parser ( op , options ) s . options = options s . port = port s . plugins = api . class . plugins @test_server_port = s . port if blk s . start ( & blk ) s end
Launches an instance of a given API server.
Launches an instance of a given API server .
The executed server
The executed server
Goliath::Server
api
The API class to launch
The API class to launch
port
The port to run the server on
The port to run the server on
options
The options hash to provide to the server
The options hash to provide to the server
blk
<not_specific>