diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-16 05:36:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-16 05:36:42 +0000 |
commit | 8c15f40acfd4171419d15b2516674a067d7d999f (patch) | |
tree | cb5a01be40ffc9f21e2eeae47d2967552d326b15 /spec | |
parent | 7a666c67664053df9e749cc81d17a2312881d436 (diff) |
parse.y: no return in class
* parse.y (k_return): prohibit return in class/module body except
for singleton class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
-rw-r--r-- | spec/ruby/language/return_spec.rb | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/spec/ruby/language/return_spec.rb b/spec/ruby/language/return_spec.rb index 6a98fa6d12..a203b79078 100644 --- a/spec/ruby/language/return_spec.rb +++ b/spec/ruby/language/return_spec.rb @@ -409,22 +409,6 @@ describe "The return keyword" do end end - describe "within a class" do - it "is allowed" do - File.write(@filename, <<-END_OF_CODE) - class A - ScratchPad << "before return" - return - - ScratchPad << "after return" - end - END_OF_CODE - - load @filename - ScratchPad.recorded.should == ["before return"] - end - end - describe "file loading" do it "stops file loading and execution" do File.write(@filename, <<-END_OF_CODE) |