summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-08-24 18:08:02 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2020-08-24 19:53:00 -0700
commit55649fbfa628c32b7fb01a8fe60105b88432b01c (patch)
tree975874bf93561a32066372ed8330a048abb2acb8 /spec
parentb4d6d62b5f613ed540c6d5e199c25fbffd3c2abe (diff)
downloadmixlib-shellout-55649fbfa628c32b7fb01a8fe60105b88432b01c.tar.gz
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 <lamont@scriptkiddie.org>
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout/helper_spec.rb11
1 files changed, 11 insertions, 0 deletions
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