@@ -209,51 +209,49 @@ def test_render_outside_path
209
209
end
210
210
end
211
211
212
- if ActionView ::Template ::SOURCE_MAPPING_SUPPORTED
213
- def test_render_template_with_syntax_error
214
- e = assert_raises ( ActionView ::Template ::Error ) { @view . render ( template : "test/syntax_error" ) }
215
- assert_match %r!syntax! , e . message
216
- assert_equal "1: <%= foo(" , e . annotated_source_code [ 0 ] . strip
217
- end
212
+ def test_render_template_with_syntax_error
213
+ e = assert_raises ( ActionView ::Template ::Error ) { silence_warnings { @view . render ( template : "test/syntax_error" ) } }
214
+ assert_match %r!syntax! , e . message
215
+ assert_equal "1: <%= foo(" , e . annotated_source_code [ 0 ] . strip
216
+ end
218
217
219
- def test_render_runtime_error
220
- ex = assert_raises ( ActionView ::Template ::Error ) {
221
- @view . render ( template : "test/runtime_error" )
222
- }
223
- erb_btl = ex . backtrace_locations . first
218
+ def test_render_runtime_error
219
+ ex = assert_raises ( ActionView ::Template ::Error ) {
220
+ @view . render ( template : "test/runtime_error" )
221
+ }
222
+ erb_btl = ex . backtrace_locations . first
224
223
225
- # Get the spot information from ErrorHighlight
226
- translating_frame = ActionDispatch ::ExceptionWrapper ::SourceMapLocation . new ( erb_btl , ex . template )
227
- translated_spot = translating_frame . spot ( ex . cause )
224
+ # Get the spot information from ErrorHighlight
225
+ translating_frame = ActionDispatch ::ExceptionWrapper ::SourceMapLocation . new ( erb_btl , ex . template )
226
+ translated_spot = translating_frame . spot ( ex . cause )
228
227
229
- assert_equal 6 , translated_spot [ :first_column ]
230
- end
228
+ assert_equal 6 , translated_spot [ :first_column ]
229
+ end
231
230
232
- def test_render_location_conditional_append
233
- ex = assert_raises ( ActionView ::Template ::Error ) {
234
- @view . render ( template : "test/unparseable_runtime_error" )
235
- }
236
- erb_btl = ex . backtrace_locations . first
231
+ def test_render_location_conditional_append
232
+ ex = assert_raises ( ActionView ::Template ::Error ) {
233
+ @view . render ( template : "test/unparseable_runtime_error" )
234
+ }
235
+ erb_btl = ex . backtrace_locations . first
237
236
238
- # Get the spot information from ErrorHighlight
239
- translating_frame = ActionDispatch ::ExceptionWrapper ::SourceMapLocation . new ( erb_btl , ex . template )
240
- translated_spot = translating_frame . spot ( ex . cause )
237
+ # Get the spot information from ErrorHighlight
238
+ translating_frame = ActionDispatch ::ExceptionWrapper ::SourceMapLocation . new ( erb_btl , ex . template )
239
+ translated_spot = translating_frame . spot ( ex . cause )
241
240
242
- assert_equal 8 , translated_spot [ :first_column ]
243
- end
241
+ assert_equal 8 , translated_spot [ :first_column ]
242
+ end
244
243
245
- def test_render_location_conditional_append_2
246
- ex = assert_raises ( ActionView ::Template ::Error ) {
247
- @view . render ( template : "test/unparseable_runtime_error_2" )
248
- }
249
- erb_btl = ex . backtrace_locations . first
244
+ def test_render_location_conditional_append_2
245
+ ex = assert_raises ( ActionView ::Template ::Error ) {
246
+ @view . render ( template : "test/unparseable_runtime_error_2" )
247
+ }
248
+ erb_btl = ex . backtrace_locations . first
250
249
251
- # Get the spot information from ErrorHighlight
252
- translating_frame = ActionDispatch ::ExceptionWrapper ::SourceMapLocation . new ( erb_btl , ex . template )
253
- translated_spot = translating_frame . spot ( ex . cause )
250
+ # Get the spot information from ErrorHighlight
251
+ translating_frame = ActionDispatch ::ExceptionWrapper ::SourceMapLocation . new ( erb_btl , ex . template )
252
+ translated_spot = translating_frame . spot ( ex . cause )
254
253
255
- assert_instance_of Integer , translated_spot [ :first_column ]
256
- end
254
+ assert_instance_of Integer , translated_spot [ :first_column ]
257
255
end
258
256
259
257
def test_render_partial
0 commit comments