redding/deas — pull request #64 by kellyredding (2013-05-17 17:11:24+00:00)
Title: adding "validation" to server configurations

This is born out of the `SinatraApp` needing to ensure its given
configuration is valid. With recent refactors a bunch of logic
has been accumulating in a set of code the SinatraApp `new` method
was calling before it created the Sinatra app.

Essentially the method needed to ensure that the config was valid.
But the configuration itself should know what that means - it is not
the responsibility of the SinatraApp to do all the things to make
a configuration valid.

So this moves all the validation logic into the configuration class,
adds the `valid?` and `validate!` methods to query and run the logic,
and then updates the server and sinatra app config handling to ensure
the validation gets run.

The result is still one config per server but now the configuration
can easily be validated by the sinatra app.

I reorganized the tests a bit. I moved the configuration tests into
their own file as that logic has grown substantially. With this
design, I was also able to add a formal unit test for the adding of the
Logging middleware. Before this had only been tested implicitly by the
rack system tests.

@jcredding ready for review. I'm gonna validate in some live scenarios and if all is well I'll go ahead and merge so I can progress other efforts - heads up!