File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -1002,34 +1002,36 @@ def custom_formatter.message_for(spot)
1002
1002
end
1003
1003
1004
1004
def test_hard_tabs
1005
- tmp = Tempfile . new ( [ "error_highlight_test" , ".rb" ] , binmode : true )
1006
- tmp << "\t \t 1.time {}\n "
1007
- tmp . close ( false )
1005
+ Tempfile . create ( [ "error_highlight_test" , ".rb" ] , binmode : true ) do | tmp |
1006
+ tmp << "\t \t 1.time {}\n "
1007
+ tmp . close
1008
1008
1009
- assert_error_message ( NoMethodError , <<~END . gsub ( "_" , "\t " ) ) do
1009
+ assert_error_message ( NoMethodError , <<~END . gsub ( "_" , "\t " ) ) do
1010
1010
undefined method `time' for 1:Integer
1011
1011
1012
1012
_ _1.time {}
1013
1013
_ _ ^^^^^
1014
1014
END
1015
1015
1016
- load tmp . path
1016
+ load tmp . path
1017
+ end
1017
1018
end
1018
1019
end
1019
1020
1020
1021
def test_no_final_newline
1021
- tmp = Tempfile . new ( [ "error_highlight_test" , ".rb" ] )
1022
- tmp << "1.time {}"
1023
- tmp . close ( false )
1022
+ Tempfile . create ( [ "error_highlight_test" , ".rb" ] ) do | tmp |
1023
+ tmp << "1.time {}"
1024
+ tmp . close
1024
1025
1025
- assert_error_message ( NoMethodError , <<~END ) do
1026
+ assert_error_message ( NoMethodError , <<~END ) do
1026
1027
undefined method `time' for 1:Integer
1027
1028
1028
1029
1.time {}
1029
1030
^^^^^
1030
1031
END
1031
1032
1032
- load tmp . path
1033
+ load tmp . path
1034
+ end
1033
1035
end
1034
1036
end
1035
1037
end
You can’t perform that action at this time.
0 commit comments