summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-08-24 21:03:36 -0700
committerGitHub <noreply@github.com>2020-08-24 21:03:36 -0700
commit261f3d2da638149a16a47a9d823696151357052b (patch)
tree1497d36162a5fa06d3a1c9f9ff599b78e3761602 /spec
parent66e4f6c8d95bb0e45d9220ce190e2139414ff328 (diff)
parent12656378755e843bd795e4d6b1fe3db669f411aa (diff)
downloadmixlib-shellout-261f3d2da638149a16a47a9d823696151357052b.tar.gz
Merge pull request #219 from chef/lcg/shellout-trace-logging
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout/helper_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/mixlib/shellout/helper_spec.rb b/spec/mixlib/shellout/helper_spec.rb
index 0c67e51..8c1136d 100644
--- a/spec/mixlib/shellout/helper_spec.rb
+++ b/spec/mixlib/shellout/helper_spec.rb
@@ -2,6 +2,18 @@ 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