Sha256: d1a3e6b5171ebcc9021f2423d9f16dfccb3555f7061c1b37d6287681c4ae0f24

Contents?: true

Size: 800 Bytes

Versions: 5

Compression:

Stored size: 800 Bytes

Contents

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

describe YARD::Handlers::C::InitHandler do
  it "should add documentation in Init_ClassName() to ClassName" do
    parse(<<-eof)
      // Bar!
      void Init_A() {
        rb_cA = rb_define_class("A", rb_cObject);
      }
    eof
    Registry.at('A').docstring.should == 'Bar!'
  end

  it "should not add documentation if ClassName is not created in Init" do
    parse(<<-eof)
      // Bar!
      void Init_A() {
      }
    eof
    Registry.at('A').should be_nil
  end

  it "should not overwrite override comment" do
    parse(<<-eof)
      /* Document-class: A
       * Foo!
       */

      // Bar!
      void Init_A() {
        rb_cA = rb_define_class("A", rb_cObject);
      }
    eof
    Registry.at('A').docstring.should == 'Foo!'
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
challah-0.6.2 vendor/bundle/gems/yard-0.8.1/spec/handlers/c/init_handler_spec.rb
challah-0.6.1 vendor/bundle/gems/yard-0.8.1/spec/handlers/c/init_handler_spec.rb
challah-0.6.0 vendor/bundle/gems/yard-0.8.1/spec/handlers/c/init_handler_spec.rb
yard-0.8.1 spec/handlers/c/init_handler_spec.rb
yard-0.8.0 spec/handlers/c/init_handler_spec.rb