summaryrefslogtreecommitdiff
path: root/test/ostruct
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-23 15:13:19 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-23 15:13:19 +0000
commitb9e18abe4a881a638d0c6cfbbffeacea43813e86 (patch)
treef63472b042e0adcae44d8b3e7e995eeade114541 /test/ostruct
parentdc215dcd9f96620b7c06a25a741d13b19c2f130b (diff)
* lib/ostruct.rb: Raise RuntimeError when modifying frozen instances
instead of TypeError. Patch by Kenichi Kamiya. [Fixes GH-383] * test/ostruct/test_ostruct.rb: Added tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ostruct')
-rw-r--r--test/ostruct/test_ostruct.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb
index d82bab9784..a472509b88 100644
--- a/test/ostruct/test_ostruct.rb
+++ b/test/ostruct/test_ostruct.rb
@@ -46,14 +46,14 @@ class TC_OpenStruct < Test::Unit::TestCase
o = OpenStruct.new
o.a = 'a'
o.freeze
- assert_raise(TypeError) {o.b = 'b'}
+ assert_raise(RuntimeError) {o.b = 'b'}
assert_not_respond_to(o, :b)
- assert_raise(TypeError) {o.a = 'z'}
+ assert_raise(RuntimeError) {o.a = 'z'}
assert_equal('a', o.a)
o = OpenStruct.new :a => 42
def o.frozen?; nil end
o.freeze
- assert_raise(TypeError, '[ruby-core:22559]') {o.a = 1764}
+ assert_raise(RuntimeError, '[ruby-core:22559]') {o.a = 1764}
end
def test_delete_field