diff options
author | Jeremy Evans <code@jeremyevans.net> | 2020-02-11 11:56:34 -0800 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2020-02-11 12:44:23 -0800 |
commit | 7a288df7b85d3565f369b305f225c2cd5baa5905 (patch) | |
tree | 994eea5130e4d2e78773b4ee383b63ff46d43740 /test | |
parent | ea32715e004dc8f56dc599883d3183d7b2635f81 (diff) |
Make yield in singleton class definitions in methods a SyntaxError
This behavior was deprecated in 2.7 and scheduled to be removed
in 3.0.
Calling yield in a class definition outside a method is now a
SyntaxError instead of a LocalJumpError, as well.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2901
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_class.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index ca78473026..82a2e55634 100644 --- a/test/ruby/test_class.rb +++ b/test/ruby/test_class.rb @@ -312,7 +312,7 @@ class TestClass < Test::Unit::TestCase end def test_invalid_yield_from_class_definition - assert_raise(LocalJumpError) { + assert_raise(SyntaxError) { EnvUtil.suppress_warning {eval("class C; yield; end")} } end |