Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
Use full module name for WeakRef constants
Browse files Browse the repository at this point in the history
  • Loading branch information
GCorbel committed Mar 5, 2024
1 parent 275c69d commit 18683bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rspec/mocks/exclude_stubbed_classes_from_subclasses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ def excluded_subclasses
@excluded_subclasses.select(&:weakref_alive?).map do |ref|
begin
ref.__getobj__
rescue RefError
rescue ::WeakRef::RefError
nil
end
end.compact
end

def exclude_subclass(constant)
@excluded_subclasses ||= []
@excluded_subclasses << WeakRef.new(constant)
@excluded_subclasses << ::WeakRef.new(constant)
end
end
RSpec::Mocks.extend(mod_something)
Expand Down

0 comments on commit 18683bf

Please sign in to comment.