Use `FrozenError` instead of `RuntimeError` in frozen object modification test
MODIFY
mrbgems/mruby-struct/test/struct.rb
mrbgems/mruby-struct/test/struct.rb
@@ -199,7 +199,7 @@ assert 'Struct#freeze' do
assert_equal :test, o.m
o.freeze
- assert_raise(RuntimeError) { o.m = :modify }
- assert_raise(RuntimeError) { o[:m] = :modify }
+ assert_raise(FrozenError) { o.m = :modify }
+ assert_raise(FrozenError) { o[:m] = :modify }
assert_equal :test, o.m
end

MODIFY
test/t/array.rb
test/t/array.rb
@@ -239,7 +239,7 @@ assert('Array#pop', '15.2.12.5.21') do
assert_equal([1,2], a)
assert_equal(3, b)
- assert_raise(RuntimeError) { [].freeze.pop }
+ assert_raise(FrozenError) { [].freeze.pop }
end
assert('Array#push', '15.2.12.5.22') do
@@ -288,7 +288,7 @@ assert('Array#shift', '15.2.12.5.27') do
assert_equal([2,3], a)
assert_equal(1, b)
- assert_raise(RuntimeError) { [].freeze.shift }
+ assert_raise(FrozenError) { [].freeze.shift }
end
assert('Array#size', '15.2.12.5.28') do
@@ -388,7 +388,7 @@ end
assert('Array#freeze') do
a = [].freeze
- assert_raise(RuntimeError) do
+ assert_raise(FrozenError) do
a[0] = 1
end
end

MODIFY
test/t/hash.rb
test/t/hash.rb
@@ -370,7 +370,7 @@ end
assert('Hash#freeze') do
h = {}.freeze
- assert_raise(RuntimeError) do
+ assert_raise(FrozenError) do
h[:a] = 'b'
end
end

MODIFY
test/t/string.rb
test/t/string.rb
@@ -711,7 +711,7 @@ assert('String#freeze') do
str = "hello"
str.freeze
- assert_raise(RuntimeError) { str.upcase! }
+ assert_raise(FrozenError) { str.upcase! }
end
assert('String literal concatenation') do

Use `FrozenError` instead of `RuntimeError` in frozen object modification test