Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make test coverage data available for smart answer flows
This is a "spike" which demonstrates how to obtain test coverage data for the `additional-commodity-code` flow. This data was not previously available [1], because the flow files were being read and eval'ed rather than simply required. The latter is necessary [2] for `SimpleCov` to record coverage data for the file. By extracting the existing DSL code into a `define` method on a subclass of `SmartAnswer::Flow`, we can safely require the file separately from instantiating the flow. This feels like a better state of affairs in general, but it specifically addresses the test coverage problem above. We'd really like to have this coverage data available so we can have confidence that we're not breaking anything as we continue to refactor the app. Note that I've intentionally not fixed the indentation in the `additional-commodity-code` flow file so that it's easier to see my changes. [1]: https://ci-new.alphagov.co.uk/job/govuk_smart_answers/2396/rcov/ [2]: simplecov-ruby/simplecov#38
- Loading branch information