File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 6
6
module GrapeSwaggerRails
7
7
class Options < OpenStruct
8
8
def before_filter ( &block )
9
- ActiveSupport ::Deprecation . warn ( 'This option is deprecated and going to be removed in 1.0.0. ' \
10
- 'Please use `before_action` instead' )
9
+ GrapeSwaggerRails . deprecator . warn (
10
+ 'This option is deprecated and going to be removed in 1.0.0. ' \
11
+ 'Please use `before_action` instead'
12
+ )
11
13
before_action ( &block )
12
14
end
13
15
@@ -43,4 +45,8 @@ def before_action(&block)
43
45
hide_url_input : false ,
44
46
hide_api_key_input : false
45
47
)
48
+
49
+ def self . deprecator
50
+ @deprecator ||= ActiveSupport ::Deprecation . new ( '1.0' , 'GrapeSwaggerRails' )
51
+ end
46
52
end
Original file line number Diff line number Diff line change 171
171
172
172
describe '#before_filter' do
173
173
before do
174
- allow ( ActiveSupport :: Deprecation ) . to receive ( :warn )
174
+ allow ( GrapeSwaggerRails . deprecator ) . to receive ( :warn )
175
175
end
176
176
177
177
it 'throws deprecation warning' do
178
178
GrapeSwaggerRails . options . before_filter { true }
179
179
180
- expect ( ActiveSupport ::Deprecation ) . to have_received ( :warn ) . with ( 'This option is deprecated ' \
181
- 'and going to be removed in 1.0.0. Please use `before_action` instead' )
180
+ expect ( GrapeSwaggerRails . deprecator ) . to have_received ( :warn ) . with (
181
+ 'This option is deprecated and going to be removed in 1.0.0. ' \
182
+ 'Please use `before_action` instead'
183
+ )
182
184
end
183
185
end
184
186
You can’t perform that action at this time.
0 commit comments