Class: Inspec::Profile::AstHelper::TestsCollector

Inherits:
CollectorBase
  • Object
show all
Defined in:
lib/inspec/utils/profile_ast_helpers.rb

Instance Attribute Summary

Attributes inherited from CollectorBase

#memo

Instance Method Summary collapse

Methods inherited from CollectorBase

#initialize

Constructor Details

This class inherits a constructor from Inspec::Profile::AstHelper::CollectorBase

Instance Method Details

#on_block(node) ⇒ Object



363
364
365
366
367
368
# File 'lib/inspec/utils/profile_ast_helpers.rb', line 363

def on_block(node)
  if RuboCop::AST::NodePattern.new("(block (send nil? :describe ...) ...)").match(node) ||
      RuboCop::AST::NodePattern.new("(block (send nil? :expect ...) ...)").match(node)
    memo[:checks] << node.source
  end
end