diff options
| author | Seba Gamboa <[email protected]> | 2015-09-25 18:01:14 -0300 |
|---|---|---|
| committer | Seba Gamboa <[email protected]> | 2015-09-25 18:01:14 -0300 |
| commit | 3a60c88a3b3dbd334e4769a6283fb90c0495c25b (patch) | |
| tree | de3d8ec187771d6e2d5f42da864c19ee6d69d890 /spec/handlers/c/source/module_handler_spec.rb | |
| parent | 82e906d74dcc943d737ced7a6ebfee1e71a74aaf (diff) | |
| download | yard-mruby-3a60c88a3b3dbd334e4769a6283fb90c0495c25b.tar.gz yard-mruby-3a60c88a3b3dbd334e4769a6283fb90c0495c25b.zip | |
Sorting tons of stuff around
Diffstat (limited to 'spec/handlers/c/source/module_handler_spec.rb')
| -rw-r--r-- | spec/handlers/c/source/module_handler_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/handlers/c/source/module_handler_spec.rb b/spec/handlers/c/source/module_handler_spec.rb new file mode 100644 index 0000000..fd08ae6 --- /dev/null +++ b/spec/handlers/c/source/module_handler_spec.rb @@ -0,0 +1,30 @@ +require_relative 'spec_helper' + +describe YARD::MRuby::Handlers::C::Source::ModuleHandler do + it "should register modules" do + parse_init 'mFoo = mrb_define_module(mrb, "Foo");' + expect(Registry.at('Foo').type).to be :module + end + + it "should register modules under namespaces" do + parse_init 'mFoo = mrb_define_module_under(mrb, mBar, "Foo");' + expect(Registry.at('Bar::Foo').type).to be :module + end + + it "should remember symbol defined with module" do + parse_init(<<-eof) + cXYZ = mrb_define_module(mrb, "Foo"); + mrb_define_method(mrb, cXYZ, "bar", bar, 0); + eof + expect(Registry.at('Foo').type).to be :module + expect(Registry.at('Foo#bar')).not_to be_nil + end + + it "should associate declaration comments as module docstring" do + parse_init(<<-eof) + /* Docstring! */ + mFoo = mrb_define_module(mrb, "Foo"); + eof + expect(Registry.at('Foo').docstring).not_to be_blank + end +end |
