Sha256: c1c0a6ae3c22f2370930c00d17f7d4b083a282b0831ba4b1d9087dd3727006a8

Contents?: true

Size: 535 Bytes

Versions: 1

Compression:

Stored size: 535 Bytes

Contents

module YARD
  module RSpecExamples
    # Handler that will set up the method <-> example map
    class ItHandler < YARD::Handlers::Ruby::Base

      handles method_call(:it)

      def process
        it_description = statement.parameters.source[1...-1]
        rspec_path_string = ParserTrace.path.dup.push(it_description).join(' ')
        #TODO: indentation depends on level of test indents.
        RSpecExampleRegistry.example_map[rspec_path_string] = statement.block.last.source.gsub("\n      ", "\n")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yard-rspec_examples-0.0.1 lib/yard/rspec_examples/it_handler.rb