Skip to content

Commit 9da5de4

Browse files
committed
remove old predicates before redefining
1 parent 9d5c6ee commit 9da5de4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/rspec/rails/configuration.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def render_views?
109109
rendering_views?
110110
end
111111

112+
undef :rendering_views? if respond_to?(:rendering_views?)
112113
def rendering_views?
113114
!!rendering_views
114115
end
@@ -117,22 +118,27 @@ def rendering_views?
117118
# to the bug fix in rspec/rspec-core#2736, note some of these
118119
# predicates are a bit nonsensical, but they exist for backwards
119120
# compatibility, we can tidy these up in `rspec-rails` 5.
121+
undef :fixture_path? if respond_to?(:fixture_path?)
120122
def fixture_path?
121123
!!fixture_path
122124
end
123125

126+
undef :global_fixtures? if respond_to?(:global_fixtures?)
124127
def global_fixtures?
125128
!!global_fixtures
126129
end
127130

131+
undef :infer_base_class_for_anonymous_controllers? if respond_to?(:infer_base_class_for_anonymous_controllers?)
128132
def infer_base_class_for_anonymous_controllers?
129133
!!infer_base_class_for_anonymous_controllers
130134
end
131135

136+
undef :use_instantiated_fixtures? if respond_to?(:use_instantiated_fixtures?)
132137
def use_instantiated_fixtures?
133138
!!use_instantiated_fixtures
134139
end
135140

141+
undef :use_transactional_fixtures? if respond_to?(:use_transactional_fixtures?)
136142
def use_transactional_fixtures?
137143
!!use_transactional_fixtures
138144
end

0 commit comments

Comments
 (0)