aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/array/fill_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/array/fill_spec.rb')
-rw-r--r--spec/ruby/core/array/fill_spec.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/ruby/core/array/fill_spec.rb b/spec/ruby/core/array/fill_spec.rb
index 96c8862208..6745bc8d09 100644
--- a/spec/ruby/core/array/fill_spec.rb
+++ b/spec/ruby/core/array/fill_spec.rb
@@ -207,8 +207,9 @@ describe "Array#fill with (filler, index, length)" do
not_supported_on :opal do
it "raises an ArgumentError or RangeError for too-large sizes" do
+ error_types = [RangeError, ArgumentError]
arr = [1, 2, 3]
- -> { arr.fill(10, 1, fixnum_max) }.should raise_error(ArgumentError)
+ -> { arr.fill(10, 1, fixnum_max) }.should raise_error { |err| error_types.should include(err.class) }
-> { arr.fill(10, 1, bignum_value) }.should raise_error(RangeError)
end
end