Module: Tester

Included in:
Gamefic::Plot, Gamefic::Subplot
Defined in:
lib/gamefic-standard/test.rb

Instance Method Summary collapse

Instance Method Details

#on_test(name = :me, &block) ⇒ Object



8
9
10
# File 'lib/gamefic-standard/test.rb', line 8

def on_test name = :me, &block
  test_procs[name] = block
end

#run_test(name, actor) ⇒ Object



12
13
14
15
16
# File 'lib/gamefic-standard/test.rb', line 12

def run_test name, actor
  queue = []
  test_procs[name].call(actor, queue)
  actor.queue.concat queue
end

#test_procsObject



4
5
6
# File 'lib/gamefic-standard/test.rb', line 4

def test_procs
  @test_procs ||= Hash.new
end