diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2021-07-13 16:53:52 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-07-13 16:54:17 +0900 |
commit | 5fd5d71a4b100fdeca55352a5441b095a1d82e16 (patch) | |
tree | bfb995c4bf921eb6ff5cfb21175ed35a4d31ec90 /test/error_highlight | |
parent | 23c8bc367c6d700789a4059b831606966efb674c (diff) | |
download | ruby-5fd5d71a4b100fdeca55352a5441b095a1d82e16.tar.gz |
[ruby/error_highlight] Support a file that has no final newline
https://github.com/ruby/error_highlight/commit/9d671284cb
Diffstat (limited to 'test/error_highlight')
-rw-r--r-- | test/error_highlight/test_error_highlight.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/error_highlight/test_error_highlight.rb b/test/error_highlight/test_error_highlight.rb index 071b3bfd3e..03909bd593 100644 --- a/test/error_highlight/test_error_highlight.rb +++ b/test/error_highlight/test_error_highlight.rb @@ -1016,4 +1016,20 @@ _ _ ^^^^^ load tmp.path end end + + def test_no_final_newline + tmp = Tempfile.new(["error_highlight_test", ".rb"]) + tmp << "1.time {}" + tmp.close(false) + + assert_error_message(NoMethodError, <<~END) do +undefined method `time' for 1:Integer + +1.time {} + ^^^^^ + END + + load tmp.path + end + end end |