summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-15 16:16:26 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-15 16:16:26 +0000
commitf11eb9bbbab9fd46b24a1fa01d35bb680da56ae8 (patch)
tree03cd88b524db2bf413e39ed559c681e06cebe576 /test
parent2cdfa81ac8773d812ba37ca40db2a52ce93775eb (diff)
merge revision(s) 32554:
* time.c (time_dup): used rb_obj_class() instead of CLASS_OF(). The patch is made by Kazuki Tsujimoto. [Bug #5012] [ruby-dev:44071] * test/ruby/test_time.rb (TestTime#test_getlocal_dont_share_eigenclass): added a new test for eigenclass of time object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_time.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index 6a00b99443..aea4c2edc0 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -697,4 +697,18 @@ class TestTime < Test::Unit::TestCase
off += 0.1
}
end
+
+ def test_getlocal_dont_share_eigenclass
+ bug5012 = "[ruby-dev:44071]"
+
+ t0 = Time.now
+ class <<t0; end
+ t1 = t0.getlocal
+
+ def t0.m
+ 0
+ end
+
+ assert_raise(NoMethodError, bug5012) { t1.m }
+ end
end