diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-19 02:49:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-19 02:49:21 +0000 |
commit | e91339cd217f7353d71498c04fb824a7f4c93c2f (patch) | |
tree | e1bb86e51a4e0b699fda7b0b32129d143a44691c /test | |
parent | 3d8929ffb4522b60566f0bae5fa755b245e55af8 (diff) | |
download | ruby-e91339cd217f7353d71498c04fb824a7f4c93c2f.tar.gz |
test_iseq.rb: shorten
* test/ruby/test_iseq.rb (TestISeq): use the utility method to get
rid of warnings and the alias to shorten.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_iseq.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index 501043eab2..f9123109f7 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -10,7 +10,7 @@ class TestISeq < Test::Unit::TestCase def compile(src, line = nil, opt = nil) EnvUtil.suppress_warning do - RubyVM::InstructionSequence.new(src, __FILE__, __FILE__, line, opt) + ISeq.new(src, __FILE__, __FILE__, line, opt) end end @@ -52,9 +52,9 @@ class TestISeq < Test::Unit::TestCase end def test_unsupport_type - ary = RubyVM::InstructionSequence.compile("p").to_a + ary = compile("p").to_a ary[9] = :foobar - assert_raise_with_message(TypeError, /:foobar/) {RubyVM::InstructionSequence.load(ary)} + assert_raise_with_message(TypeError, /:foobar/) {ISeq.load(ary)} end if defined?(RubyVM::InstructionSequence.load) def test_loaded_cdhash_mark @@ -98,7 +98,7 @@ class TestISeq < Test::Unit::TestCase end def test_line_trace - iseq = ISeq.compile \ + iseq = compile \ %q{ a = 1 b = 2 c = 3 @@ -163,9 +163,9 @@ class TestISeq < Test::Unit::TestCase def test_invalid_source bug11159 = '[ruby-core:69219] [Bug #11159]' - assert_raise(TypeError, bug11159) {ISeq.compile(nil)} - assert_raise(TypeError, bug11159) {ISeq.compile(:foo)} - assert_raise(TypeError, bug11159) {ISeq.compile(1)} + assert_raise(TypeError, bug11159) {compile(nil)} + assert_raise(TypeError, bug11159) {compile(:foo)} + assert_raise(TypeError, bug11159) {compile(1)} end def test_frozen_string_literal_compile_option |