summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-16 22:42:37 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-16 22:42:37 +0000
commitbf6c9a5c6d607cc42ca62f0effacc2c5ea4a721b (patch)
treec8b6aa4f982419cef2bfbbd7bd98ab427ff77771
parentc312111c7c61306ea11ab02d5548c779b4ea9cf9 (diff)
Spec: Fix spec/ruby/core/array/reject_spec.rb & misc
Patch by @MSP-Greg. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--spec/ruby/core/array/fixtures/classes.rb8
-rw-r--r--spec/ruby/core/array/reject_spec.rb9
2 files changed, 8 insertions, 9 deletions
diff --git a/spec/ruby/core/array/fixtures/classes.rb b/spec/ruby/core/array/fixtures/classes.rb
index 4292554724..2f8671b29a 100644
--- a/spec/ruby/core/array/fixtures/classes.rb
+++ b/spec/ruby/core/array/fixtures/classes.rb
@@ -13,15 +13,11 @@ module ArraySpecs
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
diff --git a/spec/ruby/core/array/reject_spec.rb b/spec/ruby/core/array/reject_spec.rb
index e6e5e851b6..8bce7ad3bf 100644
--- a/spec/ruby/core/array/reject_spec.rb
+++ b/spec/ruby/core/array/reject_spec.rb
@@ -126,10 +126,13 @@ describe "Array#reject!" do
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]