summaryrefslogtreecommitdiffhomepage
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/handlers/c/header/typdef_handler_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/handlers/c/header/typdef_handler_spec.rb b/spec/handlers/c/header/typdef_handler_spec.rb
new file mode 100644
index 0000000..59391e2
--- /dev/null
+++ b/spec/handlers/c/header/typdef_handler_spec.rb
@@ -0,0 +1,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