Class: NSICloudooo::FakeServerManager

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

Instance Method Summary collapse

Instance Method Details

#start_server(port = 9886) ⇒ Object

Start the nsi.cloudooo fake server

Parameters:

  • port (Fixnum) (defaults to: 9886)

    the port where the fake server will listen

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



63
64
65
66
67
68
69
70
# File 'lib/nsicloudooo/fake_server.rb', line 63

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

#stop_serverObject

Stop the SAM fake server



73
74
75
76
# File 'lib/nsicloudooo/fake_server.rb', line 73

def stop_server
  @thread.kill
  self
end