ruby-changes:52536
From: nobu <ko1@a...>
Date: Sat, 15 Sep 2018 18:25:37 +0900 (JST)
Subject: [ruby-changes:52536] nobu:r64748 (trunk): rid of warnings [Fix GH-1953]
nobu 2018-09-15 18:25:31 +0900 (Sat, 15 Sep 2018) New Revision: 64748 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64748 Log: rid of warnings [Fix GH-1953] Modified files: trunk/spec/ruby/core/enumerable/all_spec.rb trunk/spec/ruby/core/enumerable/any_spec.rb trunk/spec/ruby/core/enumerable/none_spec.rb trunk/spec/ruby/core/enumerable/one_spec.rb Index: spec/ruby/core/enumerable/all_spec.rb =================================================================== --- spec/ruby/core/enumerable/all_spec.rb (revision 64747) +++ spec/ruby/core/enumerable/all_spec.rb (revision 64748) @@ -142,10 +142,13 @@ describe "Enumerable#all?" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/enumerable/all_spec.rb#L142 pattern.yielded.should == [[0], [1], [2], [-1]] end - it "ignores block" do - @enum2.all?(NilClass) { raise }.should == false - [1, 2, nil].all?(NilClass) { raise }.should == false - {a: 1}.all?(Array) { raise }.should == true + # may raise an exception in future versions + ruby_version_is ""..."2.6" do + it "ignores block" do + @enum2.all?(NilClass) { raise }.should == false + [1, 2, nil].all?(NilClass) { raise }.should == false + {a: 1}.all?(Array) { raise }.should == true + end end it "always returns true on empty enumeration" do Index: spec/ruby/core/enumerable/one_spec.rb =================================================================== --- spec/ruby/core/enumerable/one_spec.rb (revision 64747) +++ spec/ruby/core/enumerable/one_spec.rb (revision 64748) @@ -102,10 +102,13 @@ describe "Enumerable#one?" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/enumerable/one_spec.rb#L102 pattern.yielded.should == [[0], [1], [2], [-1]] end - it "ignores block" do - @enum2.one?(NilClass) { raise }.should == true - [1, 2, nil].one?(NilClass) { raise }.should == true - {a: 1}.one?(Array) { raise }.should == true + # may raise an exception in future versions + ruby_version_is ""..."2.6" do + it "ignores block" do + @enum2.one?(NilClass) { raise }.should == true + [1, 2, nil].one?(NilClass) { raise }.should == true + {a: 1}.one?(Array) { raise }.should == true + end end it "always returns false on empty enumeration" do Index: spec/ruby/core/enumerable/any_spec.rb =================================================================== --- spec/ruby/core/enumerable/any_spec.rb (revision 64747) +++ spec/ruby/core/enumerable/any_spec.rb (revision 64748) @@ -155,10 +155,13 @@ describe "Enumerable#any?" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/enumerable/any_spec.rb#L155 pattern.yielded.should == [[0], [1], [2]] end - it "ignores block" do - @enum2.any?(NilClass) { raise }.should == true - [1, 2, nil].any?(NilClass) { raise }.should == true - {a: 1}.any?(Array) { raise }.should == true + # may raise an exception in future versions + ruby_version_is ""..."2.6" do + it "ignores block" do + @enum2.any?(NilClass) { raise }.should == true + [1, 2, nil].any?(NilClass) { raise }.should == true + {a: 1}.any?(Array) { raise }.should == true + end end it "always returns false on empty enumeration" do Index: spec/ruby/core/enumerable/none_spec.rb =================================================================== --- spec/ruby/core/enumerable/none_spec.rb (revision 64747) +++ spec/ruby/core/enumerable/none_spec.rb (revision 64748) @@ -111,10 +111,13 @@ describe "Enumerable#none?" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/enumerable/none_spec.rb#L111 pattern.yielded.should == [[0], [1], [2], [-1]] end - it "ignores block" do - @enum2.none?(Integer) { raise }.should == true - [1, 2, nil].none?(TrueClass) { raise }.should == true - {a: 1}.none?(Hash) { raise }.should == true + # may raise an exception in future versions + ruby_version_is ""..."2.6" do + it "ignores block" do + @enum2.none?(Integer) { raise }.should == true + [1, 2, nil].none?(TrueClass) { raise }.should == true + {a: 1}.none?(Hash) { raise }.should == true + end end it "always returns true on empty enumeration" do -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/