@@ -43,6 +43,13 @@ def setup
43
43
assert_equal "app/views/application/index.html.erb:4" , result [ 0 ]
44
44
end
45
45
46
+ test "#clean should omit ActionView template methods names on Ruby 3.4+" do
47
+ method_name = ActionView ::Template . new ( nil , "app/views/application/index.html.erb" , nil , locals : [ ] ) . send :method_name
48
+ backtrace = [ "app/views/application/index.html.erb:4:in 'block in #{ method_name } '" ]
49
+ result = @cleaner . clean ( backtrace , :all )
50
+ assert_equal "app/views/application/index.html.erb:4" , result [ 0 ]
51
+ end
52
+
46
53
test "#clean_frame should consider traces from irb lines as User code" do
47
54
assert_equal "(irb):1" , @cleaner . clean_frame ( "(irb):1" )
48
55
assert_nil @cleaner . clean_frame ( "/Path/to/rails/railties/lib/rails/commands/console.rb:77:in `start'" )
@@ -67,4 +74,10 @@ def setup
67
74
frame = @cleaner . clean_frame ( "app/views/application/index.html.erb:4:in `block in #{ method_name } '" , :all )
68
75
assert_equal "app/views/application/index.html.erb:4" , frame
69
76
end
77
+
78
+ test "#clean_frame should omit ActionView template methods names on Ruby 3.4+" do
79
+ method_name = ActionView ::Template . new ( nil , "app/views/application/index.html.erb" , nil , locals : [ ] ) . send :method_name
80
+ frame = @cleaner . clean_frame ( "app/views/application/index.html.erb:4:in 'block in #{ method_name } '" , :all )
81
+ assert_equal "app/views/application/index.html.erb:4" , frame
82
+ end
70
83
end
0 commit comments