Class: MockServer
- Inherits:
-
Object
- Object
- MockServer
- Defined in:
- lib/mock_server.rb
Defined Under Namespace
Instance Method Summary collapse
-
#initialize(app, port = 4000, &block) ⇒ MockServer
constructor
A new instance of MockServer.
- #start ⇒ Object
Constructor Details
#initialize(app, port = 4000, &block) ⇒ MockServer
Returns a new instance of MockServer.
9 10 11 12 |
# File 'lib/mock_server.rb', line 9 def initialize(app, port = 4000, &block) @app = app @port = port end |
Instance Method Details
#start ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/mock_server.rb', line 14 def start Thread.new do with_quiet_logger do |logger| Rack::Handler::WEBrick.run(@app, :Port => @port, :Logger => logger, :AccessLog => []) end end wait_for_service("0.0.0.0", @port) self end |