summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSeba Gamboa <[email protected]>2015-09-29 12:01:00 -0300
committerSeba Gamboa <[email protected]>2015-09-29 12:01:00 -0300
commitbe49b0e4472afbc98c386f1c14afd1598ee14d16 (patch)
tree6da29bb7e4fd2a28e5656f4be725810454af28e4
parent5aaad840a7c59a4c5f2abaead892018c7059b11e (diff)
downloadyard-mruby-be49b0e4472afbc98c386f1c14afd1598ee14d16.tar.gz
yard-mruby-be49b0e4472afbc98c386f1c14afd1598ee14d16.zip
Refactor function spec
-rw-r--r--spec/handlers/c/header/function_handler_spec.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/handlers/c/header/function_handler_spec.rb b/spec/handlers/c/header/function_handler_spec.rb
index ff1d2a8..1919fde 100644
--- a/spec/handlers/c/header/function_handler_spec.rb
+++ b/spec/handlers/c/header/function_handler_spec.rb
@@ -1,11 +1,12 @@
require_relative 'spec_helper'
describe YARD::MRuby::Handlers::C::Header::FunctionHandler do
+ subject{ Registry.at('mrb_foo') }
it "should register functions" do
header_line <<-eof
MRB_API void mrb_foo( void );
eof
- expect(Registry.at('mrb_foo')).not_to be_nil
+ expect(subject).not_to be_nil
end
it "should find docstrings attached to functions" do
@@ -14,8 +15,7 @@ describe YARD::MRuby::Handlers::C::Header::FunctionHandler do
MRB_API void mrb_foo( void );
eof
- foo = Registry.at('mrb_foo')
- expect(foo.docstring).to eq 'DOCSTRING'
+ expect(subject.docstring).to eq 'DOCSTRING'
end
it "should store the return type" do
@@ -23,8 +23,7 @@ describe YARD::MRuby::Handlers::C::Header::FunctionHandler do
MRB_API mrb_value mrb_foo( void );
eof
- foo = Registry.at('mrb_foo')
- expect(foo.tag(:return).types).to eq ['mrb_value']
+ expect(subject.tag(:return).types).to eq ['mrb_value']
end
it "should keep return type independently from docs" do
@@ -35,8 +34,8 @@ describe YARD::MRuby::Handlers::C::Header::FunctionHandler do
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']
+ expect(subject.tag(:return).text).to eq 'DOCSTRING'
+ expect(subject.tag(:return).types).to eq ['mrb_value']
end
+
end