redding/deas — pull request #110 by kellyredding (2013-11-18 18:33:30+00:00)
Title: fix for bug introduced in Sinatra v1.4.4

This manually dups the options before they are passed to Sinatra's
render method. The new render method in v1.4.4 doesn't create a
copy of the options hash anymore. So when they delete things from
the given options hash they are modifying the orig hash passed by
the user.

This breaks how Deas renders the layouts. In Deas' implementation,
the same options hash is passed to all of the nested layouts. So
they first layout render gets the options, but any subsequent layout
renders will have the modified options. Specifically, the `:locals`
option is removed. This means the first layout render will get the
locals - any subsequent will not get the locals.

Blargh. Whatever. This has Deas take responsibility for its own
options since it is reusing for all nested layouts. Deas takes
responsibility for dup'ing the options for each layout render. Why
is the performance always the one to suffer?

This also improves the rack tests to actual render some layout view
that use the locals. This was needed to reproduce this error.

The change that is causing this error is here: https://github.com/sinatra/sinatra/compare/v1.4.3...v1.4.4#diff-f2bc16b264ca20ca842cf15d82960d34L773

@jcredding ready for review.