Complete the test suite for dynamic host selection.

It was testing dynamic host selection by command, but not by environment
variable.
Merge pull request #495 from hjoliver/249.test-host-select-by-env

Complete the test suite for dynamic host selection.