shellspec icon indicating copy to clipboard operation
shellspec copied to clipboard

Sharing mocks between specs

Open kyrofa opened this issue 3 years ago • 3 comments

How do I go about defining a command-based mock that can be shared between *_spec.sh files?

kyrofa avatar Jul 18 '22 22:07 kyrofa

@kyrofa, I am wondering myself. Have you had any success by now? I am struggling with function-based commands though

Crown0815 avatar Dec 11 '23 16:12 Crown0815

Did you tried to import the mock from another file?

alexandredosim avatar Dec 11 '23 16:12 alexandredosim

I ultimately ended up (ab)using support commands for this, effectively writing my own mocks. Not ideal, but it works okay.

Did you tried to import the mock from another file?

I'm afraid I don't remember at this point what I tried.

kyrofa avatar Dec 11 '23 16:12 kyrofa