Skip to content

Commit

Permalink
remove old predicates before redefining
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Jun 10, 2020
1 parent 9d5c6ee commit 9da5de4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/rspec/rails/configuration.rb
Expand Up @@ -109,6 +109,7 @@ def render_views?
rendering_views?
end

undef :rendering_views? if respond_to?(:rendering_views?)
def rendering_views?
!!rendering_views
end
Expand All @@ -117,22 +118,27 @@ def rendering_views?
# to the bug fix in rspec/rspec-core#2736, note some of these
# predicates are a bit nonsensical, but they exist for backwards
# compatibility, we can tidy these up in `rspec-rails` 5.
undef :fixture_path? if respond_to?(:fixture_path?)
def fixture_path?
!!fixture_path
end

undef :global_fixtures? if respond_to?(:global_fixtures?)
def global_fixtures?
!!global_fixtures
end

undef :infer_base_class_for_anonymous_controllers? if respond_to?(:infer_base_class_for_anonymous_controllers?)
def infer_base_class_for_anonymous_controllers?
!!infer_base_class_for_anonymous_controllers
end

undef :use_instantiated_fixtures? if respond_to?(:use_instantiated_fixtures?)
def use_instantiated_fixtures?
!!use_instantiated_fixtures
end

undef :use_transactional_fixtures? if respond_to?(:use_transactional_fixtures?)
def use_transactional_fixtures?
!!use_transactional_fixtures
end
Expand Down

0 comments on commit 9da5de4

Please sign in to comment.