We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3efc861 commit bd8efcfCopy full SHA for bd8efcf
2 files changed
spec/utils/fixtures/this_file_raises2.rb
@@ -0,0 +1 @@
1
+raise "This is a BAD file 2"
spec/utils/name_map_spec.rb
@@ -22,6 +22,7 @@ def f; end
22
end
23
24
autoload :BadFile, "#{__dir__}/fixtures/this_file_raises.rb"
25
+ autoload :BadFile2, "#{__dir__}/fixtures/this_file_raises2.rb"
26
27
def self.n; end
28
def n; end
@@ -91,6 +92,10 @@ def n; end
91
92
expect { NameMapSpecs::BadFile }.to raise_error(RuntimeError)
93
expect(@map.class_or_module("NameMapSpecs::BadFile")).to eq(nil)
94
95
+
96
+ it "returns nil if accessing the constant raises RuntimeError when not triggering the autoload before" do
97
+ expect(@map.class_or_module("NameMapSpecs::BadFile2")).to eq(nil)
98
+ end
99
100
101
RSpec.describe NameMap, "#dir_name" do
0 commit comments