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

Commit ba59f63

Browse files
committed
Use Mutex from RSpec Support
1 parent 4ce12ff commit ba59f63

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/rspec/mocks/proxy.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
RSpec::Support.require_rspec_support "mutex"
2+
13
module RSpec
24
module Mocks
35
# @private
@@ -9,11 +11,6 @@ def ==(expectation)
911
end
1012
end
1113

12-
unless defined?(Mutex)
13-
Support.require_rspec_support 'mutex'
14-
Mutex = Support::Mutex
15-
end
16-
1714
# @private
1815
def ensure_implemented(*_args)
1916
# noop for basic proxies, see VerifyingProxy for behaviour.
@@ -25,7 +22,7 @@ def initialize(object, order_group, options={})
2522
@order_group = order_group
2623
@error_generator = ErrorGenerator.new(object)
2724
@messages_received = []
28-
@messages_received_mutex = Mutex.new
25+
@messages_received_mutex = Support::Mutex.new
2926
@options = options
3027
@null_object = false
3128
@method_doubles = Hash.new { |h, k| h[k] = MethodDouble.new(@object, k, self) }

0 commit comments

Comments
 (0)