11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/shell_mock/system_monkey_patch.rb', line 11
def override(env, command = nil, **options)
env, command = {}, env if command.nil?
stub = StubRegistry.stub_matching(env, command, options)
if stub
stub.called_with(env, command, options)
stub.side_effect.call
__un_shell_mocked_system(stub.to_oneliner)
else
if ShellMock.let_commands_run?
__un_shell_mocked_system(env, command, **options)
else
raise NoStubSpecified.new(env, command, options)
end
end
end
|