summaryrefslogtreecommitdiff
path: root/test/ripper/test_sexp.rb
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-11-17 21:15:50 -0800
committerGitHub <noreply@github.com>2020-11-17 21:15:50 -0800
commitcd0877a93e91fecb3066984b3fa2a762e6977caf (patch)
treeadbad42573151ede2116e087447485c2ae41c753 /test/ripper/test_sexp.rb
parenta776032ef183d6bc1236b2306ada5611b4d6849f (diff)
Support raise_errors keyword for Ripper.{lex,tokenize,sexp,sexp_raw}
Implements [Feature #17276]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3774 Merged-By: jeremyevans <code@jeremyevans.net>
Diffstat (limited to 'test/ripper/test_sexp.rb')
-rw-r--r--test/ripper/test_sexp.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ripper/test_sexp.rb b/test/ripper/test_sexp.rb
index 87b505a..22ee418 100644
--- a/test/ripper/test_sexp.rb
+++ b/test/ripper/test_sexp.rb
@@ -507,4 +507,9 @@ eot
assert_equal(:hshptn, hshptn[0])
assert_equal([:@label, "a:"], hshptn.dig(2, 0, 0))
end
+
+ def test_raise_errors_keyword
+ assert_raise(SyntaxError) { Ripper.sexp('def req(true) end', raise_errors: true) }
+ assert_raise(SyntaxError) { Ripper.sexp_raw('def req(true) end', raise_errors: true) }
+ end
end if ripper_test