summaryrefslogtreecommitdiff
path: root/spec/support/shared/unit/mock_shellout.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared/unit/mock_shellout.rb')
-rw-r--r--spec/support/shared/unit/mock_shellout.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/spec/support/shared/unit/mock_shellout.rb b/spec/support/shared/unit/mock_shellout.rb
index 05924e8a40..dac51be798 100644
--- a/spec/support/shared/unit/mock_shellout.rb
+++ b/spec/support/shared/unit/mock_shellout.rb
@@ -34,12 +34,15 @@ class MockShellout
exitstatus: 0,
}.merge(properties)
end
+
def method_missing(name, *args)
@properties[name.to_sym]
end
+
def error?
exitstatus != 0
end
+
def error!
raise Mixlib::ShellOut::ShellCommandFailed, "Expected process to exit with 0, but received #{exitstatus}" if error?
end