Module: SpawnExtensions

Defined in:
lib/spawn/cucumber.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object

FIXME don't know how to tell Spawn to use #add_spawn_proc without extended using extended forces to make methods class methods while this is not very clean



4
5
6
# File 'lib/spawn/cucumber.rb', line 4

def self.extended(base)
  Spawn::method proc{ |block| add_spawn_proc(block) }
end

Instance Method Details

#call_last_spawn_procObject

Calls the spawn that was created

Can be used to keep control over forked processes in your tests



11
12
13
14
15
16
17
# File 'lib/spawn/cucumber.rb', line 11

def call_last_spawn_proc
  spawns = SpawnExtensions.spawn_procs

  raise "No spawn procs left" if spawns.empty?
  
  spawns.pop.call
end