Class: NSISam::FakeServerManager

Inherits:
Object
  • Object
show all
Defined in:
lib/nsisam/fake_server.rb

Instance Method Summary collapse

Instance Method Details

#start_server(port = 8888) ⇒ Object

Start the SAM fake server

Parameters:

  • port (Fixnum) (defaults to: 8888)

    the port where the fake server will listen

    • make sure there’s not anything else listenning on this port



65
66
67
68
69
70
71
# File 'lib/nsisam/fake_server.rb', line 65

def start_server(port=8888)
  @thread = Thread.new do
    Server.run! :port => port
  end
  sleep(1)
  self
end

#stop_serverObject

Stop the SAM fake server



74
75
76
77
# File 'lib/nsisam/fake_server.rb', line 74

def stop_server
  @thread.kill
  self
end