mock library
With fisherman
fisher mock
mock ls test ls mock ls 1 test ! ls mock ls 0 "echo hi" test "hi" -eq (ls)