diff options
author | John McCrae <john.mccrae@progress.com> | 2022-04-06 09:36:34 -0700 |
---|---|---|
committer | John McCrae <john.mccrae@progress.com> | 2022-04-06 09:36:34 -0700 |
commit | 34e02d2527969f3d40cfe338f4c5dbf4fd9aa124 (patch) | |
tree | d851b0c62b9afbc6985e82e68db63ef4d09ab302 /spec | |
parent | f3df1226e3c5463d5f88600de2eaa164c9db9ef5 (diff) | |
download | ohai-34e02d2527969f3d40cfe338f4c5dbf4fd9aa124.tar.gz |
Updating For Ruby 3.1
Signed-off-by: John McCrae <john.mccrae@progress.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/mixin/shell_out_spec.rb | 9 | ||||
-rw-r--r-- | spec/unit/plugins/azure_spec.rb | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/spec/unit/mixin/shell_out_spec.rb b/spec/unit/mixin/shell_out_spec.rb index 7d08d9ff..0cf5baea 100644 --- a/spec/unit/mixin/shell_out_spec.rb +++ b/spec/unit/mixin/shell_out_spec.rb @@ -17,6 +17,7 @@ # require "spec_helper" +require "pry" describe Ohai::Mixin::ShellOut, "shell_out" do let(:cmd) { "sparkle-dream --version" } @@ -63,14 +64,14 @@ describe Ohai::Mixin::ShellOut, "shell_out" do let(:instance) { DummyPlugin.new } - before do + before(:each) do allow(instance).to receive(:logger).and_return(logger) allow(instance).to receive(:name).and_return(plugin_name) @original_env = ENV.to_hash ENV.clear end - after do + after(:each) do ENV.clear ENV.update(@original_env) end @@ -88,6 +89,10 @@ describe Ohai::Mixin::ShellOut, "shell_out" do describe "when the command does not exist" do it "logs the command and error message" do + require "pry" + Pry.config.input = STDIN + Pry.config.output = STDOUT + binding.pry expect(Mixlib::ShellOut).to receive(:new).with(cmd, options).and_return(shell_out) expect(shell_out).to receive(:run_command).and_raise(Errno::ENOENT, "sparkle-dream") expect(logger).to receive(:trace) diff --git a/spec/unit/plugins/azure_spec.rb b/spec/unit/plugins/azure_spec.rb index 4d875e80..0d9353d8 100644 --- a/spec/unit/plugins/azure_spec.rb +++ b/spec/unit/plugins/azure_spec.rb @@ -17,6 +17,7 @@ # require "spec_helper" +require "win32/registry" unless defined?(Win32::Registry) describe Ohai::System, "plugin azure" do let(:plugin) { get_plugin("azure") } |