Class: RSpec::MultiprocessRunner::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/multiprocess_runner/worker.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(complete_message, time = Time.now) ⇒ Result

Returns a new instance of Result.



342
343
344
345
346
347
348
349
350
351
# File 'lib/rspec/multiprocess_runner/worker.rb', line 342

def initialize(complete_message, time = Time.now)
  @hash = complete_message
  @run_status = complete_message["status"]
  @status = complete_message["example_status"]
  @description = complete_message["description"]
  @details = complete_message["details"]
  @filename = complete_message["filename"]
  @message = complete_message["message"]
  @time_finished = time
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



340
341
342
# File 'lib/rspec/multiprocess_runner/worker.rb', line 340

def description
  @description
end

#detailsObject (readonly)

Returns the value of attribute details.



340
341
342
# File 'lib/rspec/multiprocess_runner/worker.rb', line 340

def details
  @details
end

#filenameObject (readonly)

Returns the value of attribute filename.



340
341
342
# File 'lib/rspec/multiprocess_runner/worker.rb', line 340

def filename
  @filename
end

#messageObject (readonly)

Returns the value of attribute message.



340
341
342
# File 'lib/rspec/multiprocess_runner/worker.rb', line 340

def message
  @message
end

#run_statusObject (readonly)

Returns the value of attribute run_status.



340
341
342
# File 'lib/rspec/multiprocess_runner/worker.rb', line 340

def run_status
  @run_status
end

#statusObject (readonly)

Returns the value of attribute status.



340
341
342
# File 'lib/rspec/multiprocess_runner/worker.rb', line 340

def status
  @status
end

#time_finishedObject (readonly)

Returns the value of attribute time_finished.



340
341
342
# File 'lib/rspec/multiprocess_runner/worker.rb', line 340

def time_finished
  @time_finished
end

Class Method Details

.from_json_parse(hash) ⇒ Object



357
358
359
# File 'lib/rspec/multiprocess_runner/worker.rb', line 357

def self.from_json_parse(hash)
  Result.new(hash["hash"], Time.iso8601(hash["time"]))
end

Instance Method Details

#to_json(options = nil) ⇒ Object



353
354
355
# File 'lib/rspec/multiprocess_runner/worker.rb', line 353

def to_json(options = nil)
  { hash: @hash, time: @time_finished.iso8601(9) }.to_json
end