Sha256: eca5a791ac52b1ef2156071c52ec37f0bcf6c3214253899d7c67d66b791bbe82
Contents?: true
Size: 662 Bytes
Versions: 4
Compression:
Stored size: 662 Bytes
Contents
require 'shell_mock/monkey_patch' require 'shell_mock/stub_registry' require 'shell_mock/no_stub_specified' module ShellMock class BacktickMonkeyPatch < MonkeyPatch def method_name "`" end def interpolatable_name :backtick end def override(command) stub = StubRegistry.stub_matching({}, command, {}) if stub stub.ran stub.side_effect.call __un_shell_mocked_backtick(stub.to_oneliner) else if ShellMock.let_commands_run? __un_shell_mocked_backtick(command) else raise NoStubSpecified.new({}, command, {}) end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems