Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add spec for resolving Autoload with a Ruby object

  • Loading branch information...
commit 13d4f4989aeb9b21585dc49e95f0e4ccf17997ed 1 parent f4c3856
@dbussink dbussink authored
View
1  spec/ruby/optional/capi/ext/module_under_autoload_spec.c
@@ -3,4 +3,5 @@
void Init_module_under_autoload_spec(void) {
VALUE specs = rb_const_get(rb_cObject, rb_intern("CApiModuleSpecs"));
rb_define_module_under(specs, "ModuleUnderAutoload");
+ rb_define_module_under(specs, "RubyUnderAutoload");
}
View
3  spec/ruby/optional/capi/fixtures/module.rb
@@ -16,5 +16,8 @@ module M
class Super
end
+
autoload :ModuleUnderAutoload, "#{extension_path}/module_under_autoload_spec"
+ autoload :RubyUnderAutoload, File.expand_path('../module_autoload', __FILE__)
+
end
View
8 spec/ruby/optional/capi/module_spec.rb
@@ -40,11 +40,17 @@
mod.name.should == "CApiModuleSpecs::ModuleSpecsModuleUnder2"
end
- it "defines a module for an existing Autoload" do
+ it "defines a module for an existing Autoload with an extension" do
compile_extension("module_under_autoload")
CApiModuleSpecs::ModuleUnderAutoload.name.should == "CApiModuleSpecs::ModuleUnderAutoload"
end
+
+ it "defines a module for an existing Autoload with a ruby object" do
+ compile_extension("module_under_autoload")
+
+ CApiModuleSpecs::RubyUnderAutoload.name.should == "CApiModuleSpecs::RubyUnderAutoload"
+ end
end
describe "rb_define_const given a String name and a value" do
Please sign in to comment.
Something went wrong with that request. Please try again.