summaryrefslogtreecommitdiffhomepage
path: root/spec/handlers/c/header/typdef_handler_spec.rb
blob: 59391e2e9ebcc70ce40c19dc4b0012ade69ea31e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require_relative 'spec_helper'

describe YARD::MRuby::Handlers::C::Header::TypedefHandler do
  it "should register typedef" do
    header_line <<-eof
      typedef const char *mrb_args_format;
    eof

    expect(Registry.at('mrb_args_format')).not_to be_nil
  end

  it "should find docstrings attached to typedefs" do
    header_line <<-eof
      /**
       * Format specifiers for \ref mrb_get_args function
       */
      typedef const char *mrb_args_format;
    eof

    define = Registry.at('mrb_args_format')
    expect(define.docstring).to eq "Format specifiers for \ref mrb_get_args function"
  end
end