test/test_helper.rb in semantic_logger-4.2.0 vs test/test_helper.rb in semantic_logger-4.2.1

- old
+ new

@@ -6,27 +6,26 @@ require 'minitest/autorun' require 'minitest/reporters' require 'minitest/stub_any_instance' require 'semantic_logger' -#require 'logger' +# require 'logger' require_relative 'in_memory_appender' require_relative 'in_memory_batch_appender' require_relative 'in_memory_metrics_appender' require_relative 'in_memory_appender_helper' require 'awesome_print' -#Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new +# Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new class Minitest::Test # Use AwesomePrint to display diffs define_method :mu_pp, &:awesome_inspect # Use AwesomePrint to display messages - def message msg = nil, ending = nil, &default + def message(msg = nil, ending = nil) proc { - msg = msg.call.chomp(".") if Proc === msg - custom_message = "#{msg.ai}.\n" unless msg.nil? or msg.to_s.empty? - "#{custom_message}#{default.call}#{ending || "."}" + msg = msg.call.chomp('.') if Proc === msg + custom_message = "#{msg.ai}.\n" unless msg.nil? || msg.to_s.empty? + "#{custom_message}#{yield}#{ending || '.'}" } end - end