Skip to content

Commit

Permalink
Make check conditional to Rails version
Browse files Browse the repository at this point in the history
This PR depends on action_dispatch.show_detailed_exceptions being set,
which was only introduced in Rails 3.2.1.

Here we introduce a conditional check based on the required Rails
version in order to ensure backwards compatibility.
  • Loading branch information
Pedro Moreira authored and pedrosmmoreira committed Aug 5, 2016
1 parent b019ac0 commit a090efc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/cucumber/rails/action_controller.rb
Expand Up @@ -7,7 +7,9 @@ class ActionDispatch::ShowExceptions

def call(env)
env['action_dispatch.show_exceptions'] = !!ActionController::Base.allow_rescue
env['action_dispatch.show_detailed_exceptions'] = !ActionController::Base.allow_rescue
if Rails.version >= "3.2.1"
env['action_dispatch.show_detailed_exceptions'] = !ActionController::Base.allow_rescue
end
__cucumber_orig_call__(env)
end
end

0 comments on commit a090efc

Please sign in to comment.