If anyone has any suggestions for sane ways of thoroughly testing this module, please let me know. Unfortunately, a complete test suite would need to be able to change its EUID and consequently would need to be run as root. And to make matters worse, many machines won't have sufficiently complex user/group relationships *and* even the default usernames and group names aren't particularly predictable across platforms. Right now, the only test is that it loads and compiles, and users just have to trust me that I have tested the functionality myself.
If it were me I'd mock everything that talks to the system:
Re:Can't you just mock the system side?
drhyde on 2003-07-24T13:09:45
Good ideas, and I'll look into it. But I get the feeling that this will result in the test suite being more complex than the module, so I'll need a test suite for the test suite:-) Re:Can't you just mock the system side?
chromatic on 2003-07-25T18:26:22
That's why I write my tests first. The code tests the tests and the tests test the code. Ouroboric-driven development, that's what I always try to spell.