Let's say I have a script that invokes a command twice as part of its execution, once with arguments and once without. Example:
#!/bin/bash
foo=$(my-script)
bar=$(my-script A)
echo "'$foo' '$bar'"
with a test of
let!(mocker) {
stubbed_env.mock('my-script')
.with_args('A').outputs('1')
.with_no_args().outputs('2')
}
stdout,stderr,exitstatus = stubbed_env.execute(thing_under_test)
expect(stdout).to eql("'2' '1'")
Right now, there is no way to do this.
Let's say I have a script that invokes a command twice as part of its execution, once with arguments and once without. Example:
with a test of
Right now, there is no way to do this.