alphagov/vcloud-core — pull request #44 by mikepea (2014-05-07 15:32:30+00:00)
Title: [#70437918] ERB vars handling -- Discuss before merge!

This PR covers fixing up the Rubocop warning about 'unused argument' for 'var', albeit in a way that is a little more involved that would be expected.

The warning from Rubocop highlighted that we are not really cleanly managing the available scope of our ERB interpolation -- we were relying on the 'vars' parameter being available in the immediate scope of the method, which is then available to the underlying ERB via the self.binding call.

This PR creates an OpenStruct object with a far cleaner scope (including our vars param, vapp_name, and the local ENV), plus expands out our ERB tests to confirm that the behaviour is equivalent before and after the scope reduction.