diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-14 22:01:54 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-14 22:01:54 +0000 |
commit | d63a88c0b5015cb9d99901437b031316e1fc1155 (patch) | |
tree | 0c98a2f4789df61b961e1ecd0aa4df62d488e6b6 /test/ruby | |
parent | a1ad7b51f578dfd5f28f5c11957f03027c03e81b (diff) |
test/ruby/test_optimization.rb (test_string_size): new test
String#size may be overridden, so test for it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_optimization.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb index 2f9c0f6d22..129f62a0ff 100644 --- a/test/ruby/test_optimization.rb +++ b/test/ruby/test_optimization.rb @@ -87,6 +87,11 @@ class TestRubyOptimization < Test::Unit::TestCase assert_redefine_method('String', 'length', 'assert_nil "string".length') end + def test_string_size + assert_equal 6, "string".size + assert_redefine_method('String', 'size', 'assert_nil "string".size') + end + def test_string_empty? assert_equal true, "".empty? assert_equal false, "string".empty? |