summaryrefslogtreecommitdiff
path: root/spec/ruby/language/yield_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2023-06-26 15:55:11 +0200
committerBenoit Daloze <eregontp@gmail.com>2023-06-26 15:55:11 +0200
commit515bd4214497b3af02f6eef51b496ad9a0cf6b3b (patch)
tree4554360d275a3bb9dc696f952b8f3d1bcd88f18a /spec/ruby/language/yield_spec.rb
parentf73fa299279ac322bd921691d1ba0e8bf2b39b5f (diff)
Update to ruby/spec@30e1c35
Diffstat (limited to 'spec/ruby/language/yield_spec.rb')
-rw-r--r--spec/ruby/language/yield_spec.rb31
1 files changed, 7 insertions, 24 deletions
diff --git a/spec/ruby/language/yield_spec.rb b/spec/ruby/language/yield_spec.rb
index 05d713af70..5283517636 100644
--- a/spec/ruby/language/yield_spec.rb
+++ b/spec/ruby/language/yield_spec.rb
@@ -186,31 +186,14 @@ describe "The yield call" do
end
describe "Using yield in a singleton class literal" do
- ruby_version_is ""..."3.0" do
- it 'emits a deprecation warning' do
- code = <<~RUBY
- def m
- class << Object.new
- yield
- end
- end
- m { :ok }
- RUBY
-
- -> { eval(code) }.should complain(/warning: `yield' in class syntax will not be supported from Ruby 3.0/)
- end
- end
-
- ruby_version_is "3.0" do
- it 'raises a SyntaxError' do
- code = <<~RUBY
- class << Object.new
- yield
- end
- RUBY
+ it 'raises a SyntaxError' do
+ code = <<~RUBY
+ class << Object.new
+ yield
+ end
+ RUBY
- -> { eval(code) }.should raise_error(SyntaxError, /Invalid yield/)
- end
+ -> { eval(code) }.should raise_error(SyntaxError, /Invalid yield/)
end
end