Sha256: c6e6976bd430a777cf2c15d7fdaef154e008cbb1c6718bd059ae4b23de7b7677

Contents?: true

Size: 1.23 KB

Versions: 8

Compression:

Stored size: 1.23 KB

Contents

require File.dirname(__FILE__) + "/spec_helper"

describe YARD::Handlers::C::OverrideCommentHandler do
  [:class, :module].each do |type|
    it "handles Document-#{type}" do
      parse(<<-eof)
        void something;
        /* Document-#{type}: A
         * Foo bar baz
         */
        void
      eof
      expect(Registry.at('A').type).to eq type
      expect(Registry.at('A').docstring).to eq 'Foo bar baz'
      expect(Registry.at('A').file).to eq '(stdin)'
      expect(Registry.at('A').line).to eq 2
    end
  end

  it "handles multiple class/module combinations" do
    parse(<<-eof)
      /* Document-class: A
       * Document-class: B
       * Document-module: C
       * Foo bar baz
       */
    eof
    expect(Registry.at('A').docstring).to eq 'Foo bar baz'
    expect(Registry.at('B').docstring).to eq 'Foo bar baz'
    expect(Registry.at('C').docstring).to eq 'Foo bar baz'
    expect(Registry.at('C').type).to eq :module
  end

  it "handles Document-class with inheritance" do
    parse(<<-eof)
      /* Document-class: A < B
       * Foo bar baz
       */
      void
    eof
    obj = Registry.at('A')
    expect(obj.type).to eq :class
    expect(obj.docstring).to eq 'Foo bar baz'
    expect(obj.superclass).to eq P('B')
  end
end

Version data entries

8 entries across 7 versions & 2 rubygems

Version Path
abaci-0.3.0 vendor/bundle/gems/yard-0.9.2/spec/handlers/c/override_comment_handler_spec.rb
abaci-0.3.0 vendor/bundle/gems/yard-0.9.1/spec/handlers/c/override_comment_handler_spec.rb
yard-0.9.5 spec/handlers/c/override_comment_handler_spec.rb
yard-0.9.4 spec/handlers/c/override_comment_handler_spec.rb
yard-0.9.3 spec/handlers/c/override_comment_handler_spec.rb
yard-0.9.2 spec/handlers/c/override_comment_handler_spec.rb
yard-0.9.1 spec/handlers/c/override_comment_handler_spec.rb
yard-0.9.0 spec/handlers/c/override_comment_handler_spec.rb