Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make GovukError.configure behave as a singleton
This is to prevent any surprising behaviour should the downstream app decide to call 'GovukError.configure' twice. Prior to this commit, calling twice would keep all the Raven configuration but lose any custom configuration. I then needed to edit the 'govuk_error_spec' configure test to prevent `double("Configuration")` from leaking between tests. I also found that the change would cause configuring_spec.rb to fail, as the initialised GovukError module would no longer be looking for the SENTRY_CURRENT_ENV variable at the time the test would run. Once I changed this test to accommodate the singleton pattern, we no longer needed the `config.current_environment=` line, which was only really there to satisfy configuring_spec.rb. The line is unnecessary as the default behaviour is to delegate that to Raven, which is already being set via the ENV variable, so we don't need to create that ourselves. We also no longer need configuring_spec itself - its behaviour is now tested in govuk_error_spec.
- Loading branch information