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

Commit 54b9d35

Browse files
committed
Suppress a warning by setting $VERBOSE to nil
1 parent 476b6e9 commit 54b9d35

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/rspec/mocks/verifying_double.rb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,15 @@ def method_missing(message, *args, &block)
3434
super
3535
end
3636

37-
# @private
38-
module SilentIO
39-
def self.method_missing(*); end
40-
def self.respond_to?(*)
41-
true
42-
end
43-
end
44-
4537
# Redefining `__send__` causes ruby to issue a warning.
46-
old, $stderr = $stderr, SilentIO
38+
old, $VERBOSE = $VERBOSE, nil
4739
def __send__(name, *args, &block)
4840
@__sending_message = name
4941
super
5042
ensure
5143
@__sending_message = nil
5244
end
53-
$stderr = old
45+
$VERBOSE = old
5446

5547
def send(name, *args, &block)
5648
__send__(name, *args, &block)

0 commit comments

Comments
 (0)