From d034793bd327d78aba0d99d719336d597e2413b0 Mon Sep 17 00:00:00 2001 From: Seba Gamboa Date: Tue, 29 Sep 2015 11:51:21 -0300 Subject: Handle return types --- spec/handlers/c/header/function_handler_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'spec') 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 -- cgit v1.2.3