Class: RSpecItHandler

Inherits:
YARD::Handlers::Ruby::Base
  • Object
show all
Defined in:
lib/yard-examples-from-rspec.rb

Overview

Handler that will set up the method <-> example map

Instance Method Summary collapse

Instance Method Details

#processObject



20
21
22
23
24
25
# File 'lib/yard-examples-from-rspec.rb', line 20

def process
  param = statement.parameters.first.jump(:string_content).source
  if param =~ Regexp.union(*EXAMPLE_MATCHERS)
    RSpecExampleRegistry.example_map[RSpecDescribeHandler.current_path] =  statement.last.last.source.gsub("\n      ","\n")
  end
end