ruby-changes:52886
From: marcandre <ko1@a...>
Date: Wed, 17 Oct 2018 07:42:41 +0900 (JST)
Subject: [ruby-changes:52886] marcandRe: r65098 (trunk): Spec: Fix spec/ruby/core/array/reject_spec.rb & misc
marcandre 2018-10-17 07:42:37 +0900 (Wed, 17 Oct 2018) New Revision: 65098 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65098 Log: Spec: Fix spec/ruby/core/array/reject_spec.rb & misc Patch by @MSP-Greg. Modified files: trunk/spec/ruby/core/array/fixtures/classes.rb trunk/spec/ruby/core/array/reject_spec.rb Index: spec/ruby/core/array/fixtures/classes.rb =================================================================== --- spec/ruby/core/array/fixtures/classes.rb (revision 65097) +++ spec/ruby/core/array/fixtures/classes.rb (revision 65098) @@ -13,15 +13,11 @@ module ArraySpecs https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/array/fixtures/classes.rb#L13 SampleCount = 1000 def self.frozen_array - frozen_array = [1,2,3] - frozen_array.freeze - frozen_array + [1,2,3].freeze end def self.empty_frozen_array - frozen_array = [] - frozen_array.freeze - frozen_array + [].freeze end def self.recursive_array Index: spec/ruby/core/array/reject_spec.rb =================================================================== --- spec/ruby/core/array/reject_spec.rb (revision 65097) +++ spec/ruby/core/array/reject_spec.rb (revision 65098) @@ -126,10 +126,13 @@ describe "Array#reject!" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/array/reject_spec.rb#L126 a = [1, 2, 3, 4] begin a.reject! do |x| - return true if x == 2 - raise raise StandardError, 'Oops' if x == 3 + case x + when 2 then true + when 3 then raise StandardError, 'Oops' + else false + end end - rescue + rescue StandardError end a.should == [1, 3, 4] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/