diff --git a/lib/kangaru/application.rb b/lib/kangaru/application.rb index d1e0445..c753616 100644 --- a/lib/kangaru/application.rb +++ b/lib/kangaru/application.rb @@ -29,7 +29,7 @@ def run!(argv) def autoloader @autoloader ||= Zeitwerk::Loader.new.tap do |loader| loader.inflector = Zeitwerk::GemInflector.new(root_file) - loader.push_dir(app_dir) + loader.push_dir(app_dir, namespace:) end end end diff --git a/sig/zeitwerk/loader.rbs b/sig/zeitwerk/loader.rbs index 953a25e..9079d8e 100755 --- a/sig/zeitwerk/loader.rbs +++ b/sig/zeitwerk/loader.rbs @@ -6,7 +6,7 @@ module Zeitwerk def collapse: (Array[String]) -> void - def push_dir: (String dir) -> void + def push_dir: (String dir, ?namespace: Module) -> void def setup: -> void end diff --git a/spec/kangaru/application_spec.rb b/spec/kangaru/application_spec.rb index eeca991..3d31142 100644 --- a/spec/kangaru/application_spec.rb +++ b/spec/kangaru/application_spec.rb @@ -47,7 +47,11 @@ it "configures the loader to load the app dir" do setup - expect(loader).to have_received(:push_dir).with(application.app_dir).once + + expect(loader) + .to have_received(:push_dir) + .with(application.app_dir, namespace:) + .once end it "enables the instantiated loader" do