summaryrefslogtreecommitdiffhomepage
path: root/spec/handlers/c/mruby_method_handler_spec.rb
diff options
context:
space:
mode:
authorSeba Gamboa <[email protected]>2015-09-24 12:40:55 -0300
committerSeba Gamboa <[email protected]>2015-09-24 12:40:55 -0300
commit36407e1eb5c274f5e19b0f55114d4c66f5de7753 (patch)
treeebf383d6c8a207884323aec1486a0e4b2fb28b71 /spec/handlers/c/mruby_method_handler_spec.rb
parent7b633663385725c6665118dc5fc014c26e7ffc04 (diff)
downloadyard-mruby-36407e1eb5c274f5e19b0f55114d4c66f5de7753.tar.gz
yard-mruby-36407e1eb5c274f5e19b0f55114d4c66f5de7753.zip
Move MRuby c Handlers into YARD::MRuby and disable defaults
Diffstat (limited to 'spec/handlers/c/mruby_method_handler_spec.rb')
-rw-r--r--spec/handlers/c/mruby_method_handler_spec.rb48
1 files changed, 0 insertions, 48 deletions
diff --git a/spec/handlers/c/mruby_method_handler_spec.rb b/spec/handlers/c/mruby_method_handler_spec.rb
deleted file mode 100644
index 4ae86fb..0000000
--- a/spec/handlers/c/mruby_method_handler_spec.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require_relative 'spec_helper'
-
-describe YARD::Handlers::C::MRubyMethodHandler do
- it "should register methods" do
- parse_init <<-eof
- mFoo = mrb_define_module(mrb, "Foo");
- mrb_define_method(mrb, mFoo, "bar", bar, MRB_ARGS_NONE());
- eof
- expect(Registry.at('Foo#bar')).not_to be_nil
- expect(Registry.at('Foo#bar').visibility).to be :public
- end
-
- it "should register singleton methods" do
- parse_init <<-eof
- mFoo = mrb_define_module("Foo");
- mrb_define_singleton_method(mrb, mFoo, "bar", bar, MRB_ARGS_NONE());
- eof
- expect(Registry.at('Foo.bar')).not_to be_nil
- expect(Registry.at('Foo.bar').visibility).to be :public
- end
-
- it "should register module functions" do
- parse <<-eof
- /* DOCSTRING
- * @return [String] foo!
- */
- static mrb_value bar(mrb_state *mrb, mrb_value self) { x(); y(); z(); }
-
- void mrb_foo_gem_init(mrb_state *mrb) {
- mFoo = mrb_define_module(mrb, "Foo");
- mrb_define_module_function(mrb, mFoo, "bar", bar, MRB_ARGS_NONE());
- }
- eof
- bar_c = Registry.at('Foo.bar')
- bar_i = Registry.at('Foo#bar')
-
- expect(bar_c).to be_module_function
- expect(bar_c.visibility).to be :public
- expect(bar_c.docstring).to eq "DOCSTRING"
- expect(bar_c.tag(:return).object).to eq bar_c
- expect(bar_c.source).to eq "static mrb_value bar(mrb_state *mrb, mrb_value self) { x(); y(); z(); }"
- expect(bar_i).not_to be_module_function
- expect(bar_i.visibility).to be :private
- expect(bar_i.docstring).to eq "DOCSTRING"
- expect(bar_i.tag(:return).object).to eq bar_i
- expect(bar_i.source).to eq bar_c.source
- end
-end