Unverified Commit 3f7cd468 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4333 from...

Merge pull request #4333 from shuujii/use-FrozenError-instead-of-RuntimeError-in-frozen-obj-mod-test

Use `FrozenError` instead of `RuntimeError` in frozen object modification test
parents cd3bf55b fbad7a15
...@@ -199,7 +199,7 @@ assert 'Struct#freeze' do ...@@ -199,7 +199,7 @@ assert 'Struct#freeze' do
assert_equal :test, o.m assert_equal :test, o.m
o.freeze o.freeze
assert_raise(RuntimeError) { o.m = :modify } assert_raise(FrozenError) { o.m = :modify }
assert_raise(RuntimeError) { o[:m] = :modify } assert_raise(FrozenError) { o[:m] = :modify }
assert_equal :test, o.m assert_equal :test, o.m
end end
...@@ -239,7 +239,7 @@ assert('Array#pop', '15.2.12.5.21') do ...@@ -239,7 +239,7 @@ assert('Array#pop', '15.2.12.5.21') do
assert_equal([1,2], a) assert_equal([1,2], a)
assert_equal(3, b) assert_equal(3, b)
assert_raise(RuntimeError) { [].freeze.pop } assert_raise(FrozenError) { [].freeze.pop }
end end
assert('Array#push', '15.2.12.5.22') do assert('Array#push', '15.2.12.5.22') do
...@@ -288,7 +288,7 @@ assert('Array#shift', '15.2.12.5.27') do ...@@ -288,7 +288,7 @@ assert('Array#shift', '15.2.12.5.27') do
assert_equal([2,3], a) assert_equal([2,3], a)
assert_equal(1, b) assert_equal(1, b)
assert_raise(RuntimeError) { [].freeze.shift } assert_raise(FrozenError) { [].freeze.shift }
end end
assert('Array#size', '15.2.12.5.28') do assert('Array#size', '15.2.12.5.28') do
...@@ -388,7 +388,7 @@ end ...@@ -388,7 +388,7 @@ end
assert('Array#freeze') do assert('Array#freeze') do
a = [].freeze a = [].freeze
assert_raise(RuntimeError) do assert_raise(FrozenError) do
a[0] = 1 a[0] = 1
end end
end end
...@@ -370,7 +370,7 @@ end ...@@ -370,7 +370,7 @@ end
assert('Hash#freeze') do assert('Hash#freeze') do
h = {}.freeze h = {}.freeze
assert_raise(RuntimeError) do assert_raise(FrozenError) do
h[:a] = 'b' h[:a] = 'b'
end end
end end
...@@ -711,7 +711,7 @@ assert('String#freeze') do ...@@ -711,7 +711,7 @@ assert('String#freeze') do
str = "hello" str = "hello"
str.freeze str.freeze
assert_raise(RuntimeError) { str.upcase! } assert_raise(FrozenError) { str.upcase! }
end end
assert('String literal concatenation') do assert('String literal concatenation') do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment