diff options
author | Marc-Andre Lafortune <github@marc-andre.ca> | 2020-09-02 15:34:33 -0400 |
---|---|---|
committer | Marc-Andre Lafortune <github@marc-andre.ca> | 2020-09-04 01:23:14 -0400 |
commit | fbaab562d99c220bd481c17522c02c865ba7c44c (patch) | |
tree | 5fe4020a5b9117d5ce779af2bdbdac26aa0c0ed5 /test | |
parent | 3b0bcaf2872e5ab6d2475e9cd6dd5c374d93ae0b (diff) | |
download | ruby-fbaab562d99c220bd481c17522c02c865ba7c44c.tar.gz |
lib/ostruct.rb: Revert "To use RuntimeError instead of FrozenError for old ruby versions."
This reverts commit 4cd1fc8b3559353069860eee90b1b5bade013917.
Diffstat (limited to 'test')
-rw-r--r-- | test/ostruct/test_ostruct.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb index afe6affdc0..831598086d 100644 --- a/test/ostruct/test_ostruct.rb +++ b/test/ostruct/test_ostruct.rb @@ -66,16 +66,15 @@ class TC_OpenStruct < Test::Unit::TestCase o = OpenStruct.new(foo: 42) o.a = 'a' o.freeze - expected_error = defined?(FrozenError) ? FrozenError : RuntimeError - assert_raise(expected_error) {o.b = 'b'} + assert_raise(FrozenError) {o.b = 'b'} assert_not_respond_to(o, :b) - assert_raise(expected_error) {o.a = 'z'} + assert_raise(FrozenError) {o.a = 'z'} assert_equal('a', o.a) assert_equal(42, o.foo) o = OpenStruct.new :a => 42 def o.frozen?; nil end o.freeze - assert_raise(expected_error, '[ruby-core:22559]') {o.a = 1764} + assert_raise(FrozenError, '[ruby-core:22559]') {o.a = 1764} end def test_delete_field |