aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/language
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-07 16:40:27 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-07 16:40:27 +0000
commit713279550ad33836e5d7bbbb5b801aa13def24dc (patch)
tree5117074ae9fefc45750ba41bdf121599dbf9a0ca /spec/ruby/language
parent75334db3c6479ea3cd7462d36ca5464d386f9c72 (diff)
downloadruby-713279550ad33836e5d7bbbb5b801aa13def24dc.tar.gz
Fix specs for yield in singleton class being deprecated
* Use eval to trigger warning only when the method is called. * Suppress warnings and clarify this will be removed in 3.0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/language')
-rw-r--r--spec/ruby/language/class_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/ruby/language/class_spec.rb b/spec/ruby/language/class_spec.rb
index a91b165ffe..41a9c0f189 100644
--- a/spec/ruby/language/class_spec.rb
+++ b/spec/ruby/language/class_spec.rb
@@ -285,8 +285,12 @@ describe "A class definition extending an object (sclass)" do
}.should raise_error(TypeError)
end
- it "allows accessing the block of the original scope" do
- ClassSpecs.sclass_with_block { 123 }.should == 123
+ ruby_version_is ""..."3.0" do
+ it "allows accessing the block of the original scope" do
+ suppress_warning do
+ ClassSpecs.sclass_with_block { 123 }.should == 123
+ end
+ end
end
it "can use return to cause the enclosing method to return" do