Sha256: afd261cea99efa7606751abf79099dce875810fb7ec8ebc3218a1c40a875850f

Contents?: true

Size: 1.2 KB

Versions: 63

Compression:

Stored size: 1.2 KB

Contents

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

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

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

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

Version data entries

63 entries across 49 versions & 7 rubygems

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