features/step_definitions/logging_steps.rb in message-driver-0.2.2 vs features/step_definitions/logging_steps.rb in message-driver-0.3.0
- old
+ new
@@ -6,11 +6,11 @@
step "an empty file named \"#{LOG_FILE_NAME}\""
in_current_dir do
@logger = Logger.new(LOG_FILE_NAME)
end
step "I set the log level to #{level || "info"}"
- scenario_config[:logger] = @logger
+ @orig_logger, MessageDriver.logger = MessageDriver.logger, @logger
end
Given(/^I set the log level to (#{STRING_OR_SYM})$/) do |level|
level = level ? level.to_s.upcase : "INFO"
@logger.level = Logger::SEV_LABEL.find_index(level)
@@ -22,7 +22,11 @@
After do
if @logger
@logger.close
@logger = nil
+ end
+ if @orig_logger
+ MessageDriver.logger = @orig_logger
+ @orig_logger = nil
end
end