opscode/test-kitchen — pull request #171 by fnichol (2013-07-21 19:10:30+00:00)
Title: Support computed default values for Driver authors.

This feature augments the `default_config` method provided to Driver
authors by allowing a block to be passed which provides a way to
delay or compute a default value using another default (or provided
value).

For example, a driver author can now write `default_config` values such
as:

```ruby
class Kitchen::Driver::BelAirCloud < Kitchen::Driver::Base

default_config :region, "west-philadelphia"

default_config :endpoint_url do |driver|
"http://#{driver[:region]}.belair-cloud.com/api"
end
end
```

In the above example `driver[:endpoint_url]` will be computed when
called using the current driver object for context. Driver authors will
have access to the underlying config Hash (using `driver[:my_key]`) and
the associated instance object (using `driver.instance` for access to
data such as `instance.name`).

Note that any config data that is provided via the Kitchen YAML will
override any `default_config` values or blocks.