Class: RSpec::Parallel::SocketBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/parallel/socket_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ SocketBuilder

Returns a new instance of SocketBuilder.



6
7
8
# File 'lib/rspec/parallel/socket_builder.rb', line 6

def initialize(path)
  @path = path
end

Instance Method Details

#run(retry_counter = 3) ⇒ BasicSocket?

Returns:

  • (BasicSocket, nil)


11
12
13
14
15
16
17
18
19
20
# File 'lib/rspec/parallel/socket_builder.rb', line 11

def run(retry_counter = 3)
  build
rescue
  retry_counter -= 1
  if retry_counter > 0
    sleep rand
    retry
  end
  nil
end