Well, what I don't like about these tests are, that they are too "smart" and not obvious how it works. There is too many indirections and you need to study how it works and why something stop working.
I more like approach, where the beggining of test include some mock outputs from external scripts and expected result and you test it. So it is clear, what is tested and what should be result when I have just quick look at it.
It is also against general idea of "spec" style writting of tests. Where test should be more like specification how your API or program works. so it should be something like:
```
it "can set and save the default target when target exists" do
...
if "raise exception when setting default target when target doesn't exist" do
```
etc.
see e.g. guideline how to write better spec style tests: http://betterspecs.org/