Class: YardMiniTestSpecItHandler

Inherits:
YARD::Handlers::Ruby::Base
  • Object
show all
Defined in:
lib/yard-minitest-spec/handler.rb

Constant Summary collapse

VERSION =
YardMiniTestSpec::VERSION

Instance Method Summary collapse

Instance Method Details

#processObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/yard-minitest-spec/handler.rb', line 23

def process
  return if owner.nil?
  obj = P(owner[:spec])
  return if obj.is_a?(Proxy)
  # ignore comments etc
  if statement.last.last.source.chomp.size > 0
    (obj[:specifications] ||= []) << {
      name: statement.parameters.first.jump(:string_content).source,
      file: statement.file,
      line: statement.line,
      source: statement.last.last.source.chomp
    }
  end
end