Sha256: c3ed3a9d9f33be9b74cc6a1b2d062914458472687747a5022bbebca10d6b6cbe

Contents?: true

Size: 779 Bytes

Versions: 21

Compression:

Stored size: 779 Bytes

Contents

# frozen_string_literal: true
require 'stringio'

include Handlers

def undoc_error(code)
  expect { StubbedSourceParser.parse_string(code) }.to raise_error(Parser::UndocumentableError)
end

def with_parser(parser_type)
  tmp = StubbedSourceParser.parser_type
  StubbedSourceParser.parser_type = parser_type
  yield
  StubbedSourceParser.parser_type = tmp
end

class StubbedProcessor < Processor
  def process(statements)
    statements.each_with_index do |stmt, _index|
      find_handlers(stmt).each do |handler|
        handler.new(self, stmt).process
      end
    end
  end
end

class StubbedSourceParser < Parser::SourceParser
  StubbedSourceParser.parser_type = :ruby
  def post_process
    post = StubbedProcessor.new(self)
    post.process(@parser.enumerator)
  end
end

Version data entries

21 entries across 20 versions & 4 rubygems

Version Path
yard-0.9.24 spec/handlers/spec_helper.rb
yard-0.9.23 spec/handlers/spec_helper.rb
yard-0.9.22 spec/handlers/spec_helper.rb
yard-0.9.21 spec/handlers/spec_helper.rb
yard-0.9.20 spec/handlers/spec_helper.rb
yard-0.9.19 spec/handlers/spec_helper.rb
yard-0.9.16 spec/handlers/spec_helper.rb
yard-0.9.15 spec/handlers/spec_helper.rb
yard-0.9.14 spec/handlers/spec_helper.rb
yard-0.9.13 spec/handlers/spec_helper.rb
yard-0.9.12 spec/handlers/spec_helper.rb
yard-0.9.11 spec/handlers/spec_helper.rb
yard-0.9.10 spec/handlers/spec_helper.rb
yard-0.9.9 spec/handlers/spec_helper.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.4.0/gems/yard-0.9.8/spec/handlers/spec_helper.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.2.0/gems/yard-0.9.8/spec/handlers/spec_helper.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/yard-0.9.8/spec/handlers/spec_helper.rb
yard-0.9.8 spec/handlers/spec_helper.rb
abaci-0.3.0 vendor/bundle/gems/yard-0.9.7/spec/handlers/spec_helper.rb
yard-0.9.7 spec/handlers/spec_helper.rb