summaryrefslogtreecommitdiffhomepage
path: root/spec/handlers/c/header/function_handler_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/handlers/c/header/function_handler_spec.rb')
-rw-r--r--spec/handlers/c/header/function_handler_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/handlers/c/header/function_handler_spec.rb b/spec/handlers/c/header/function_handler_spec.rb
index dc42c91..ff1d2a8 100644
--- a/spec/handlers/c/header/function_handler_spec.rb
+++ b/spec/handlers/c/header/function_handler_spec.rb
@@ -17,4 +17,26 @@ describe YARD::MRuby::Handlers::C::Header::FunctionHandler do
foo = Registry.at('mrb_foo')
expect(foo.docstring).to eq 'DOCSTRING'
end
+
+ it "should store the return type" do
+ header_line <<-eof
+ MRB_API mrb_value mrb_foo( void );
+ eof
+
+ foo = Registry.at('mrb_foo')
+ expect(foo.tag(:return).types).to eq ['mrb_value']
+ end
+
+ it "should keep return type independently from docs" do
+ header_line <<-eof
+ /**
+ * @return DOCSTRING
+ */
+ MRB_API mrb_value mrb_foo( void );
+ eof
+
+ foo = Registry.at('mrb_foo')
+ expect(foo.tag(:return).text).to eq 'DOCSTRING'
+ expect(foo.tag(:return).types).to eq ['mrb_value']
+ end
end