Class: ATP::Processors::PostCleaner::ExtractTestIDs

Inherits:
ATP::Processor show all
Defined in:
lib/atp/processors/post_cleaner.rb

Overview

Extracts all ID values of tests within the given AST

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ATP::Processor

#handler_missing, #n, #n0, #n1, #n2, #process, #run

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



12
13
14
# File 'lib/atp/processors/post_cleaner.rb', line 12

def results
  @results
end

Instance Method Details

#on_test(node) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/atp/processors/post_cleaner.rb', line 14

def on_test(node)
  id = node.children.find { |n| n.type == :id }
  if id
    @results ||= {}
    @results[id] = true
  end
end