diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-05-27 11:05:51 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-05-27 11:05:51 +0900 |
commit | 0aa9b003de353e690f31ba59ca0a2db1df51b8bf (patch) | |
tree | c1e073fe1a01afb234e4ff3a19fba0a15b876cc5 /test/irb | |
parent | 9840f52c77a928479919e539d2e47ce36b5ede49 (diff) | |
download | ruby-0aa9b003de353e690f31ba59ca0a2db1df51b8bf.tar.gz |
context.rb: hide wrapping lines
* lib/irb/context.rb (IRB::Context#evaluate): separate the code
from wrapping lines to propagate the given exception, not to show
the wrapping lines when SyntaxError.
Diffstat (limited to 'test/irb')
-rw-r--r-- | test/irb/test_context.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb index 96e6fbfc61..8b245d105d 100644 --- a/test/irb/test_context.rb +++ b/test/irb/test_context.rb @@ -52,6 +52,11 @@ module TestIRB } assert_equal('foo', e.message) assert_same(e, @context.evaluate('$!', 1, exception: e)) + e = assert_raise(SyntaxError) { + @context.evaluate("1,2,3", 1, exception: e) + } + assert_match(/\A\(irb\):1:/, e.message) + assert_not_match(/rescue _\.class/, e.message) end def test_eval_input |