diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/erb/test_erb.rb | 6 | ||||
-rw-r--r-- | test/objspace/test_objspace.rb | 4 | ||||
-rw-r--r-- | test/ruby/test_settracefunc.rb | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb index 555345a140..24f6cc5d89 100644 --- a/test/erb/test_erb.rb +++ b/test/erb/test_erb.rb @@ -251,6 +251,12 @@ EOS assert_equal("line\r\n" * 3, erb.result) end + def test_safe_level_warning + assert_warning(/#{__FILE__}:#{__LINE__ + 1}/) do + @erb.new("", 1) + end + end + def test_invalid_trim_mode pend if RUBY_ENGINE == 'truffleruby' diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index e1aa57e46e..39fa72e7dd 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -203,8 +203,8 @@ class TestObjSpace < Test::Unit::TestCase assert_equal(line1, ObjectSpace.allocation_sourceline(o1)) assert_equal(__FILE__, ObjectSpace.allocation_sourcefile(o1)) assert_equal(c1, ObjectSpace.allocation_generation(o1)) - assert_equal(Class.name, ObjectSpace.allocation_class_path(o1)) - assert_equal(:new, ObjectSpace.allocation_method_id(o1)) + assert_equal(self.class.name, ObjectSpace.allocation_class_path(o1)) + assert_equal(__method__, ObjectSpace.allocation_method_id(o1)) assert_equal(__FILE__, ObjectSpace.allocation_sourcefile(o2)) assert_equal(line2, ObjectSpace.allocation_sourceline(o2)) diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 55c07abbea..fac6dd8185 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -1999,7 +1999,7 @@ CODE TracePoint.new(:c_call, &capture_events).enable{ c.new } - assert_equal [:c_call, :itself, :initialize], events[1] + assert_equal [:c_call, :itself, :initialize], events[0] events.clear o = Class.new{ |