lib/rspec/logging_helper.rb in logging-1.8.2 vs lib/rspec/logging_helper.rb in logging-2.0.0
- old
+ new
@@ -5,12 +5,12 @@
# Capture log messages from the Logging framework and make them
# available via a @log_output instance variable. The @log_output
# supports a readline method to access the log messages.
#
def capture_log_messages( opts = {} )
- from = opts.getopt(:from, 'root')
- to = opts.getopt(:to, '__rspec__')
- exclusive = opts.getopt(:exclusive, true)
+ from = opts.fetch(:from, 'root')
+ to = opts.fetch(:to, '__rspec__')
+ exclusive = opts.fetch(:exclusive, true)
appender = Logging::Appenders[to] || Logging::Appenders::StringIo.new(to)
logger = Logging::Logger[from]
if exclusive
logger.appenders = appender