Class: Tap::Test::Tracer

Inherits:
Middleware
  • Object
show all
Defined in:
lib/tap/test/tracer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stack) ⇒ Tracer

Returns a new instance of Tracer.



10
11
12
13
14
# File 'lib/tap/test/tracer.rb', line 10

def initialize(stack)
  @stack = stack
  @results = {}
  @runlist = []
end

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



7
8
9
# File 'lib/tap/test/tracer.rb', line 7

def results
  @results
end

#runlistObject (readonly)

Returns the value of attribute runlist.



8
9
10
# File 'lib/tap/test/tracer.rb', line 8

def runlist
  @runlist
end

#stackObject (readonly)

Returns the value of attribute stack.



6
7
8
# File 'lib/tap/test/tracer.rb', line 6

def stack
  @stack
end

Instance Method Details

#call(node, inputs = []) ⇒ Object



16
17
18
19
20
21
# File 'lib/tap/test/tracer.rb', line 16

def call(node, inputs=[])
  runlist << node
  result = stack.call(node, inputs)
  (results[node] ||= []) << result
  result
end