Sha256: 3aaa2aa9679821dd449fb92cb50f5b04fc211e55287865384537ad00abc447b7

Contents?: true

Size: 823 Bytes

Versions: 68

Compression:

Stored size: 823 Bytes

Contents

require File.join(File.dirname(__FILE__), "..", "spec_helper")
require 'stringio'

include Handlers

def undoc_error(code)
  lambda { StubbedSourceParser.parse_string(code) }.should raise_error(Parser::UndocumentableError)
end

def with_parser(parser_type, &block)
  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

68 entries across 52 versions & 7 rubygems

Version Path
yard-0.8.7.6 spec/handlers/spec_helper.rb
yard-0.8.7.5 spec/handlers/spec_helper.rb
climine-0.0.7 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/handlers/spec_helper.rb
climine-0.0.7 vendor/bundle/ruby/2.1.0/gems/yard-0.8.7.3/spec/handlers/spec_helper.rb
climine-0.0.6 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/handlers/spec_helper.rb
climine-0.0.5 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/handlers/spec_helper.rb
yard-0.8.7.4 spec/handlers/spec_helper.rb
climine-0.0.4 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/handlers/spec_helper.rb
climine-0.0.3 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/handlers/spec_helper.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/yard-0.8.7.3/spec/handlers/spec_helper.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/spec/handlers/spec_helper.rb
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/spec/handlers/spec_helper.rb
climine-0.0.2 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/handlers/spec_helper.rb
climine-0.0.1 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/handlers/spec_helper.rb
yard-0.8.7.3 spec/handlers/spec_helper.rb
yard-0.8.7.2 spec/handlers/spec_helper.rb
candlepin-api-0.4.0 bundle/ruby/gems/yard-0.8.7/spec/handlers/spec_helper.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/yard-0.8.7/spec/handlers/spec_helper.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/yard-0.8.7/spec/handlers/spec_helper.rb
yard-0.8.7.1 spec/handlers/spec_helper.rb