sethvargo/chefspec — pull request #506 by tdooner (2014-10-17 00:20:07+00:00)
Title: Add environment_path support

Hello! We do the monolith chef repository thing, and run `rspec` at its root to run chefspec against all our cookbooks in the `cookbooks/` folder. It works pretty well because we only have one platform & version to test against.

Anyhow, we also do a thing where some of our application cookbooks depend on attributes specified only in environment files – e.g. the environment specifies `default['mysql']['master'] = 'foobar:3306'` and then we output that value into a config file in an application cookbook.

Ideally, we would be able to test this scenario with chefspec without explicitly setting all these attributes in an rspec `before` block. It appears that chefspec supports a `role_path` configuration option (which would apply the attributes in the role at run-list-expansion-time) but there is no parallel `environment_path` option (which also applies attributes at run-list-expansion-time).

I copy-pasted the roles-related config settings, since environments are the basically the same kind of config option, but I'm happy to take any feedback and resubmit a different approach.

Cheers!