Class: MagazineSlave

Inherits:
Object
  • Object
show all
Includes:
DRb::DRbUndumped
Defined in:
lib/spork/run_strategy/magazine/magazine_slave.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id_num, test_framework_short_name) ⇒ MagazineSlave

Returns a new instance of MagazineSlave.



9
10
11
12
13
14
15
16
# File 'lib/spork/run_strategy/magazine/magazine_slave.rb', line 9

def initialize(id_num, test_framework_short_name)
  @id_num = id_num
  @test_framework = Spork::TestFramework.factory(STDOUT, STDERR,
                                                 test_framework_short_name)
#    ENV["DRB"] = 'true'
#    Spork.using_spork!
  return(nil) unless preload
end

Instance Attribute Details

#id_numObject (readonly)

Returns the value of attribute id_num.



8
9
10
# File 'lib/spork/run_strategy/magazine/magazine_slave.rb', line 8

def id_num
  @id_num
end

Instance Method Details

#preloadObject



26
27
28
# File 'lib/spork/run_strategy/magazine/magazine_slave.rb', line 26

def preload
  @test_framework.preload
end

#run(argv, stderr, stdout) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/spork/run_strategy/magazine/magazine_slave.rb', line 18

def run(argv, stderr, stdout)
  $stdout, $stderr = stdout, stderr
  Spork.exec_each_run
  load @test_framework.helper_file
  @test_framework.run_tests(argv, stderr, stdout)
  puts "  <-- Slave(#{@id_num}) run done!"; stdout.flush
end