Skip to content

Commit eeae6ef

Browse files
committed
Tweak to exclude-loading rescue logic, suggested by @nobu.
1 parent 7b90ff4 commit eeae6ef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/mri/lib/minitest/unit.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,10 @@ def self.inherited klass # :nodoc:
13671367
if ENV["EXCLUDES"]
13681368
begin
13691369
exclude_src = File.read File.join(ENV["EXCLUDES"], klass.inspect.gsub("::", "/") + ".rb")
1370+
rescue Errno::ENOENT
1371+
# no excludes for this class
1372+
else
1373+
# excludes available, proceed
13701374
excludes = {}
13711375
klass.send :instance_variable_set, :@excludes, excludes
13721376

@@ -1377,8 +1381,6 @@ def exclude(name, reason)
13771381
end
13781382

13791383
klass.class_eval exclude_src
1380-
rescue Errno::ENOENT
1381-
# no excludes for this class
13821384
end
13831385
end
13841386

0 commit comments

Comments
 (0)