solid_errors
solid_errors copied to clipboard
Skip subscribe on test
https://github.com/fractaledmind/solid_errors/blob/b75251b35c28e53f4339cc01f2ed519367c7a6f0/lib/solid_errors/engine.rb#L15-L17
This line works on every RAILS_ENV.
I wrote ugly workaround on my config/environments/test.rb
config.after_initialize do
Rails.error.unsubscribe(SolidErrors::Subscriber)
end
Which solution would be better?
- Hard cord:
Rails.error.subscribe(SolidErrors::Subscriber.new) unless Rails.env.test? - Supply
config.rails_error_subscriber(default to true?) - Supply
config.rails_error_subscribe_envs(default to["production"]?) - Add unsubscribe document on
README