From 55649fbfa628c32b7fb01a8fe60105b88432b01c Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 24 Aug 2020 18:08:02 -0700 Subject: fix the helper spec test not pulling in mixlib-log as a test dep, but just monkeypatching a trace level into the ruby logger Signed-off-by: Lamont Granquist --- spec/mixlib/shellout/helper_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'spec') diff --git a/spec/mixlib/shellout/helper_spec.rb b/spec/mixlib/shellout/helper_spec.rb index 0c67e51..aadc6d0 100644 --- a/spec/mixlib/shellout/helper_spec.rb +++ b/spec/mixlib/shellout/helper_spec.rb @@ -2,6 +2,17 @@ require "spec_helper" require "mixlib/shellout/helper" require "logger" +# to use this helper you need to either: +# 1. use mixlib-log which has a trace level +# 2. monkeypatch a trace level into ruby's logger like this +# 3. override the __io_for_live_stream method +# +class Logger + module Severity; TRACE=-1;end + def trace(progname = nil, &block);add(TRACE, nil, progname, &block);end + def trace?; @level <= TRACE; end +end + describe Mixlib::ShellOut::Helper, ruby: ">= 2.3" do class TestClass include Mixlib::ShellOut::Helper -- cgit v1.2.1