patch 8.0.1448: segfault with exception inside :rubyfile command
Problem: Segmentation fault when Ruby throws an exception inside :rubyfile
command.
Solution: Use rb_protect() instead of rb_load_protect(). (ujihisa,
closes #2147, greywolf, closes #2512, #2511)
diff --git a/src/testdir/test_ruby.vim b/src/testdir/test_ruby.vim
index 174467f..0017f73 100644
--- a/src/testdir/test_ruby.vim
+++ b/src/testdir/test_ruby.vim
@@ -49,3 +49,11 @@
bwipe!
bwipe!
endfunc
+
+func Test_rubyfile()
+ " Check :rubyfile does not SEGV with Ruby level exception but just fails
+ let tempfile = tempname() . '.rb'
+ call writefile(['raise "vim!"'], tempfile)
+ call assert_fails('rubyfile ' . tempfile)
+ call delete(tempfile)
+endfunc