test-kitchen/test-kitchen — pull request #300 by ChrisLundquist (2013-12-20 07:30:48+00:00)
Title: SSH ENV as hash

This is the lowest impact way I see to get a better way for managing the remote env.

Sadly, openssh won't let us set the env in the channel like net/ssh warns, so we do have to prepend the variable to the command.

To me, passing env vars prepended as a string is an implementation detail, and having the interface of taking a hash seems nicer. This way, people could even do crazy thing like pass `ENV` from ruby to the remote.

[Here is how I tested this](https://gist.github.com/ChrisLundquist/8051513)

As you can see, setting the env in channel produces our error messages.

The variables are still there though, because we join and prepend the hash in front of the command.

I left the broken ssh variable in channel method there for now mostly as a reminder for people of why we have to prepend it. We can remove it, but I didn't want any one else to waste time duplicated the failed experiment.