It looks like ```session.sys.config.getenv``` doesn't look very easy to do. But you can definitely ```double``` the ```session``` object, and then stub ```platform```. You can also stub ```cmd_exec``` to make sure you're processing the ```env``` correctly.

@limhoff-r7 is much better than me at rspec so maybe he has a different opinion.