diff --git a/lib/ronin/core/class_registry.rb b/lib/ronin/core/class_registry.rb index 4993b23..b18a640 100644 --- a/lib/ronin/core/class_registry.rb +++ b/lib/ronin/core/class_registry.rb @@ -192,7 +192,7 @@ def load_class_from_file(file) previous_entries = registry.keys - load(file) + require(file) new_entries = registry.keys - previous_entries diff --git a/spec/class_registry_spec.rb b/spec/class_registry_spec.rb index d69d5f0..9cc2a24 100644 --- a/spec/class_registry_spec.rb +++ b/spec/class_registry_spec.rb @@ -105,12 +105,10 @@ class Foo let(:file) { File.join(subject.class_dir,"#{id}.rb") } let(:klass) { ExampleClassRegistry::LoadedClass } - it "must load the file" do - expect(subject).to receive(:load).with(file) do - load(file) - end - + it "must require the file" do subject.load_class_from_file(file) + + expect($LOADED_FEATURES).to include(file) end it "must return the registered module" do @@ -128,7 +126,7 @@ class Foo let(:absolute_path) { File.expand_path(relative_path) } it "must expand the path first" do - expect(subject).to receive(:load).with(absolute_path) do + expect(subject).to receive(:require).with(absolute_path) do load(absolute_path) end @@ -160,6 +158,7 @@ class Foo after do subject.registry.clear + $LOADED_FEATURES.delete(file) end end