summaryrefslogtreecommitdiffhomepage
path: root/spec
diff options
context:
space:
mode:
authorSeba Gamboa <[email protected]>2017-01-26 22:11:40 -0800
committerGitHub <[email protected]>2017-01-26 22:11:40 -0800
commitf443012c63bc8e5f086358479210b4da11b161ee (patch)
tree61b6b37b091b7cd2d115e22088064b88d363463a /spec
parent4caa5e98ac14feeb8dcb4cf6af4add4aaf228628 (diff)
parenta1bca6e247872d93d2d3b10ed36f2a3800edda8a (diff)
downloadyard-mruby-f443012c63bc8e5f086358479210b4da11b161ee.tar.gz
yard-mruby-f443012c63bc8e5f086358479210b4da11b161ee.zip
Merge pull request #16 from jmhmccr/yard-0-9-compatibility
Update to Yard >= 0.9.0
Diffstat (limited to 'spec')
-rw-r--r--spec/code_objects/header_object_spec.rb10
-rw-r--r--spec/code_objects/spec_helper.rb1
-rw-r--r--spec/handlers/c/source/class_handler_spec.rb6
-rw-r--r--spec/handlers/c/source/module_handler_spec.rb6
4 files changed, 21 insertions, 2 deletions
diff --git a/spec/code_objects/header_object_spec.rb b/spec/code_objects/header_object_spec.rb
new file mode 100644
index 0000000..2e10a70
--- /dev/null
+++ b/spec/code_objects/header_object_spec.rb
@@ -0,0 +1,10 @@
+require_relative 'spec_helper'
+
+describe YARD::MRuby::CodeObjects::HeaderObject do
+ before { Registry.clear }
+
+ it "should return the name of the header for the path" do
+ header_object = YARD::MRuby::CodeObjects::HeaderObject.new(nil, :"mruby.h")
+ expect(header_object.path).to eq("mruby.h")
+ end
+end
diff --git a/spec/code_objects/spec_helper.rb b/spec/code_objects/spec_helper.rb
new file mode 100644
index 0000000..935238d
--- /dev/null
+++ b/spec/code_objects/spec_helper.rb
@@ -0,0 +1 @@
+require_relative '../spec_helper'
diff --git a/spec/handlers/c/source/class_handler_spec.rb b/spec/handlers/c/source/class_handler_spec.rb
index bfac3b6..ac97bc8 100644
--- a/spec/handlers/c/source/class_handler_spec.rb
+++ b/spec/handlers/c/source/class_handler_spec.rb
@@ -8,7 +8,11 @@ describe YARD::MRuby::Handlers::C::Source::ClassHandler do
end
it "should register classes under namespaces" do
- parse_init 'cFoo = mrb_define_class_under(mrb, cBar, "Foo", rb_cObject);'
+ parse_init(<<-eof)
+ cBar = mrb_define_class(mrb, "Bar", mrb->object_class);
+ cFoo = mrb_define_class_under(mrb, cBar, "Foo", rb_cObject);'
+ eof
+
expect(Registry.at('Bar::Foo').type).to be :class
end
diff --git a/spec/handlers/c/source/module_handler_spec.rb b/spec/handlers/c/source/module_handler_spec.rb
index fd08ae6..9641eb3 100644
--- a/spec/handlers/c/source/module_handler_spec.rb
+++ b/spec/handlers/c/source/module_handler_spec.rb
@@ -7,7 +7,11 @@ describe YARD::MRuby::Handlers::C::Source::ModuleHandler do
end
it "should register modules under namespaces" do
- parse_init 'mFoo = mrb_define_module_under(mrb, mBar, "Foo");'
+ parse_init(<<-eof)
+ cBar = mrb_define_module(mrb,"Bar");
+ cFoo = mrb_define_module_under(mrb, cBar, "Foo");
+ eof
+
expect(Registry.at('Bar::Foo').type).to be :module
end