summaryrefslogtreecommitdiffhomepage
path: root/spec
diff options
context:
space:
mode:
authorSeba Gamboa <[email protected]>2015-09-29 11:51:21 -0300
committerSeba Gamboa <[email protected]>2015-09-29 11:51:21 -0300
commitd034793bd327d78aba0d99d719336d597e2413b0 (patch)
tree3b4527efc2d554ddea6cd4c28b71edf85b9d2e7c /spec
parent5c3e2565132aa2b0141580c2caabbe2c6a8c2470 (diff)
downloadyard-mruby-d034793bd327d78aba0d99d719336d597e2413b0.tar.gz
yard-mruby-d034793bd327d78aba0d99d719336d597e2413b0.zip
Handle return types
Diffstat (limited to 'spec')
-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