zachfeldman/rubypress — pull request #9 by pseudomuto (2014-01-18 18:57:58+00:00)
Title: Optionally load env file

# Load Environment Variables from `.env`

Currently running the test suite requires the `WORDPRESS_HOST`, `WORDPRESS_USERNAME` and `WORDPRESS_PASSWORD` environment variables to be set.

This can be accomplished by specifying their values directly `WORDPRESS_HOST=xxx.com bundle exec rake test` or by exporting each one before running the tests, like this: `export WORDPRESS_HOST=xxx.com`

This PR allows developers to define a _.env_ file in the root of the gem. If this file exists, rspec will load it and set the environment variables for the particular test run.

I've ignored the .env file so that no one accidentally commits their credentials.

I realize there are gems like dotenv and figaro out there, but I didn't think it was worth the added dependency in this situation.

I've updated the README to include details