mike-burns/rcm — pull request #6 by pbrisbin (2013-08-23 21:07:51+00:00)
Title: Cram test suite, fix lsrc bug, add custom rcrc ability

This is three separate features, but the commits should be cherry-pick-able.

#### Add a test suite

This is an acceptance test suite, not a unit test suite, which is a shame, but I think the best we can do. I've added instructions for running the tests to DEVELOPERS.md. I'm finding cram to be quite nice.

The coverage is not complete, but my motivation is waning, so I'd like to get this in even if it's partial. Adding more tests as we go and ensuring any new features come with tests is a good way forward I think. mkrc and lsrc are well covered, rcup has a test or two as does rcrc.

#### Fix a bug in lsrc

Handling multiple `-d` options was not working correctly. I traced it back to mis-behaving pushdir/popdir logic. To fix this, I just removed all that :). By re-structuring some things, we can just use normal `cd` and `cd $OLDPWD` to get back. I hope my assessment of the situation was correct -- but hey, the tests pass!

#### Source `RCM_CONFIG` which defaults to `~/.rcrc`

I tried to add an option to specify a config file, but it needed to be sourced before option parsing for most of rcm to work. Rather than fight the chicken-and-the-egg, I just chose to use an environment variable. I also consolidated the sourcing into rcm.sh.