Skip to content

Commit f50bb4a

Browse files
committed
Add specs for exception backtrace of the methods that becomes inlined
1 parent 9f6d8af commit f50bb4a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

spec/truffle/always_inlined_spec.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,42 @@
8787
}.should raise_error(ArgumentError) { |e| e.backtrace_locations[0].label.should == 'initialize_copy' }
8888
end
8989

90+
it "for Symbol#to_proc" do
91+
-> {
92+
:a.to_proc(:wrong)
93+
}.should raise_error(ArgumentError) { |e| e.backtrace_locations[0].label.should == 'to_proc' }
94+
end
95+
96+
it "for BasicObject#instance_eval" do
97+
-> {
98+
BasicObject.new.instance_eval
99+
}.should raise_error(ArgumentError) { |e| e.backtrace_locations[0].label.should == 'instance_eval' }
100+
end
101+
102+
it "for Module#class_eval" do
103+
-> {
104+
Module.new.class_eval
105+
}.should raise_error(ArgumentError) { |e| e.backtrace_locations[0].label.should == 'class_eval' }
106+
end
107+
108+
it "for Module#module_eval" do
109+
-> {
110+
Module.new.module_eval
111+
}.should raise_error(ArgumentError) { |e| e.backtrace_locations[0].label.should == 'module_eval' }
112+
end
113+
114+
it "for Module#define_method" do
115+
-> {
116+
Module.new.define_method(:wrong)
117+
}.should raise_error(ArgumentError) { |e| e.backtrace_locations[0].label.should == 'define_method' }
118+
end
119+
120+
it "for Module#instance_method" do
121+
-> {
122+
Module.new.instance_method([])
123+
}.should raise_error(TypeError) { |e| e.backtrace_locations[0].label.should == 'instance_method' }
124+
end
125+
90126
guard -> { RUBY_ENGINE != "ruby" } do
91127
it "for #send" do
92128
-> {

0 commit comments

Comments
 (0)