Updated

spec/support / show_exceptions.rb

A
27 lines of codes
1 methods
6.9 complexity/method
1 churn
6.86 complexity
23 duplications
module ShowExceptionsHelper
  1. ShowExceptionsHelper has no descriptive comment
def with_show_exceptions(on_or_off, &block)
  1. ShowExceptionsHelper#with_show_exceptions doesn't depend on instance state (maybe move it to another class?)
begin env_config = Rails.application.env_config show_exceptions = env_config['action_dispatch.show_exceptions'] env_config['action_dispatch.show_exceptions'] = on_or_off yield ensure env_config['action_dispatch.show_exceptions'] = show_exceptions end end end RSpec.configure do |config| config.include(ShowExceptionsHelper, type: :request) config.around(:each, type: :request) do |example|
  1. Similar code found in 2 nodes Locations: 0 1
if example.metadata.key?(:show_exceptions) with_show_exceptions(example.metadata[:show_exceptions]) do example.run end else example.run end end end