Sha256: e8ee347fe325ba1ba769cccc80c0a78bba04d962f6628597be1fde1c1b6a32e4

Contents?: true

Size: 1.03 KB

Versions: 21

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true
require File.dirname(__FILE__) + '/spec_helper'

RSpec.describe YARD::Handlers::Processor do
  before do
    @proc = Handlers::Processor.new(OpenStruct.new(:parser_type => :ruby))
  end

  it "starts with public visibility" do
    expect(@proc.visibility).to eq :public
  end

  it "starts in instance scope" do
    expect(@proc.scope).to eq :instance
  end

  it "starts in root namespace" do
    expect(@proc.namespace).to eq Registry.root
  end

  it "has a globals structure" do
    expect(@proc.globals).to be_a(OpenStruct)
  end

  it "ignores HandlerAborted exceptions (but print debug info)" do
    class AbortHandlerProcessor < YARD::Handlers::Ruby::Base
      process { abort! }
    end
    stmt = OpenStruct.new(:line => 1, :show => 'SOURCE')
    allow(@proc).to receive(:find_handlers).and_return([AbortHandlerProcessor])
    expect(log).to receive(:debug).with(/AbortHandlerProcessor cancelled from/)
    expect(log).to receive(:debug).with("\tin file '(stdin)':1:\n\nSOURCE\n")
    @proc.process([stmt])
  end
end

Version data entries

21 entries across 20 versions & 4 rubygems

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