File tree Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- code_ownership (1.33.0 )
4+ code_ownership (1.33.1 )
55 code_teams (~> 1.0 )
66 packs
77 sorbet-runtime (>= 0.5.10821 )
Original file line number Diff line number Diff line change 11Gem ::Specification . new do |spec |
22 spec . name = 'code_ownership'
3- spec . version = '1.33.0 '
3+ spec . version = '1.33.1 '
44 spec . authors = [ 'Gusto Engineers' ]
55 spec . email = [ '[email protected] ' ] 66 spec . summary = 'A gem to help engineering teams declare ownership of code'
Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ def self.path_from_klass(klass)
7070 else
7171 nil
7272 end
73+ rescue NameError
74+ nil
7375 end
7476
7577 #
Original file line number Diff line number Diff line change 210210 expect ( CodeOwnership ) . to_not have_received ( :for_file )
211211 expect ( Object ) . to_not have_received ( :const_source_location )
212212 end
213+
214+ it 'returns nil if the class constant cannot be found' do
215+ allow ( CodeOwnership ) . to receive ( :for_file )
216+ allow ( Object ) . to receive ( :const_source_location ) . and_raise ( NameError )
217+ expect ( CodeOwnership . for_class ( MyFile ) ) . to eq nil
218+ end
213219 end
214220
215221 describe '.for_team' do
You can’t perform that action at this time.
0 commit comments