Module: SpawnExtensions
- Defined in:
- lib/spawnling/cucumber.rb
Class Method Summary collapse
-
.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.
Instance Method Summary collapse
-
#call_last_spawn_proc ⇒ Object
Calls the spawn that was created .
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/spawnling/cucumber.rb', line 4 def self.extended(base) Spawn::method proc{ |block| add_spawn_proc(block) } end |
Instance Method Details
#call_last_spawn_proc ⇒ Object
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/spawnling/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 |