class ParallelRSpec::Client
Attributes
Public Class Methods
Source
# File lib/parallel_rspec/client.rb, line 34 def initialize(channel_to_server) @channel_to_server = channel_to_server end
Public Instance Methods
Source
# File lib/parallel_rspec/client.rb, line 66 def deprecation(hash) channel_to_server.write([:deprecation, hash]) end
Source
# File lib/parallel_rspec/client.rb, line 82 def dumpable_exception(exception) return exception if exception.nil? || exception.is_a?(ExceptionMarshallingWrapper) ExceptionMarshallingWrapper.new(exception.class.name, exception.to_s, exception.backtrace, dumpable_exception(exception.cause)) end
Source
# File lib/parallel_rspec/client.rb, line 54 def example_failed(example) channel_to_server.write([:example_failed, example.id, updates_from(example)]) end
Source
# File lib/parallel_rspec/client.rb, line 58 def example_finished(example) channel_to_server.write([:example_finished, example.id, updates_from(example)]) end
Source
# File lib/parallel_rspec/client.rb, line 42 def example_group_finished(group) # ditto end
Source
# File lib/parallel_rspec/client.rb, line 38 def example_group_started(group) # not implemented yet - would need the same extraction/simplification for serialization as Example below end
Source
# File lib/parallel_rspec/client.rb, line 50 def example_passed(example) channel_to_server.write([:example_passed, example.id, updates_from(example)]) end
Source
# File lib/parallel_rspec/client.rb, line 62 def example_pending(example) channel_to_server.write([:example_pending, example.id, updates_from(example)]) end
Source
# File lib/parallel_rspec/client.rb, line 46 def example_started(example) channel_to_server.write([:example_started, example.id, updates_from(example)]) end
Source
# File lib/parallel_rspec/client.rb, line 87 def next_example_to_run return nil if RSpec.world.wants_to_quit channel_to_server.write([:next_example_to_run]) channel_to_server.read end
Source
# File lib/parallel_rspec/client.rb, line 93 def result(success) channel_to_server.write([:result, success]) end
Source
# File lib/parallel_rspec/client.rb, line 70 def updates_from(example) example.execution_result.exception = dumpable_exception(example.execution_result.exception) { exception: dumpable_exception(example.exception), metadata: example.metadata.slice( :execution_result, :pending, :skip, ) } end