Class: Foodtaster::RSpecRun
- Inherits:
-
Object
- Object
- Foodtaster::RSpecRun
- Defined in:
- lib/foodtaster/rspec_run.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ RSpecRun
constructor
A new instance of RSpecRun.
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize ⇒ RSpecRun
Returns a new instance of RSpecRun.
5 6 7 8 9 |
# File 'lib/foodtaster/rspec_run.rb', line 5 def initialize @client = nil @server_process = nil @stopped = false end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/foodtaster/rspec_run.rb', line 3 def client @client end |
Class Method Details
.current ⇒ Object
40 41 42 |
# File 'lib/foodtaster/rspec_run.rb', line 40 def current @instance ||= self.new end |
Instance Method Details
#start ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/foodtaster/rspec_run.rb', line 11 def start setup_signal_handlers start_server_and_connect_client if @client && @server_process && !@server_process.alive? Foodtaster.logger.fatal "Failed to start Foodtaster DRb Server:\n\n#{@server_process.output}" exit 1 elsif !@client || !@server_process Foodtaster.logger.fatal "Failed to connect to Foodtaster DRb Server" exit 1 end end |
#stop ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/foodtaster/rspec_run.rb', line 24 def stop return if @stopped @stopped = true puts "" # newline after rspec output Vm.shutdown_running_vms if Foodtaster.config.shutdown_vms terminate_server end |