Permalink
Browse files

Export test env number

  • Loading branch information...
1 parent a79929d commit 0af927eba23b0b4a3a94f8f4aa7ee6e8400af836 Brian Dunn committed with Hashrocket Workstation Jun 23, 2012
Showing with 7 additions and 4 deletions.
  1. +2 −2 lib/flatware/cli.rb
  2. +5 −2 lib/flatware/worker.rb
View
@@ -31,10 +31,10 @@ def work
desc "default", "starts workers and gives them work"
def default
Flatware.verbose = options[:log]
- processors.times do
+ processors.times do |i|
fork do
log "work"
- Worker.listen!
+ Worker.listen! i
end
end
fork do
View
@@ -16,11 +16,14 @@ def clock_in
task.send 'hi'
end
- def listen!
+ def listen!(worker_number='')
+ ENV['TEST_ENV_NUMBER'] = worker_number.to_s
fireable
clock_in
fireable.until_fired task do |message|
- Cucumber.run message, $stdout, $stderr
+ log 'working!'
+ Cucumber.run message
+ log 'waiting'
task.send 'done'
end
end

0 comments on commit 0af927e

Please sign in to comment.