File tree Expand file tree Collapse file tree 5 files changed +32
-28
lines changed Expand file tree Collapse file tree 5 files changed +32
-28
lines changed Original file line number Diff line number Diff line change 2
2
require_relative 'fixtures/classes'
3
3
4
4
ruby_version_is "2.6" do
5
- describe "#eval_script" do
6
- ScratchPad . record [ ]
5
+ describe "TracePoint#eval_script" do
6
+ it "is the evald source code" do
7
+ ScratchPad . record [ ]
7
8
8
- script = <<-CODE
9
- def foo
10
- p :hello
9
+ script = <<-CODE
10
+ def foo
11
+ p :hello
12
+ end
13
+ CODE
14
+
15
+ TracePoint . new ( :script_compiled ) do |e |
16
+ ScratchPad << e . eval_script
17
+ end . enable do
18
+ eval script
11
19
end
12
- CODE
13
20
14
- TracePoint . new ( :script_compiled ) do |e |
15
- ScratchPad << e . eval_script
16
- end . enable do
17
- eval script
21
+ ScratchPad . recorded . should == [ script ]
18
22
end
19
-
20
- ScratchPad . recorded . should == [ script ]
21
23
end
22
24
end
Original file line number Diff line number Diff line change 2
2
require_relative 'fixtures/classes'
3
3
4
4
ruby_version_is "2.6" do
5
- describe "#instruction_sequence" do
6
- ScratchPad . record [ ]
5
+ describe "TracePoint#instruction_sequence" do
6
+ it "is an instruction sequence" do
7
+ ScratchPad . record [ ]
7
8
8
- script = <<-CODE
9
- def foo
10
- p :hello
9
+ script = <<-CODE
10
+ def foo
11
+ p :hello
12
+ end
13
+ CODE
14
+
15
+ TracePoint . new ( :script_compiled ) do |e |
16
+ ScratchPad << e . instruction_sequence
17
+ end . enable do
18
+ eval script
11
19
end
12
- CODE
13
20
14
- TracePoint . new ( :script_compiled ) do |e |
15
- ScratchPad << e . instruction_sequence
16
- end . enable do
17
- eval script
21
+ ScratchPad . recorded . size . should == 1
22
+ ScratchPad . recorded [ 0 ] . class . should == RubyVM ::InstructionSequence
18
23
end
19
-
20
- ScratchPad . recorded . size . should == 1
21
- ScratchPad . recorded [ 0 ] . class . should == RubyVM ::InstructionSequence
22
24
end
23
25
end
Original file line number Diff line number Diff line change
1
+ fails:TracePoint#eval_script is the evald source code
Original file line number Diff line number Diff line change
1
+ fails:TracePoint#instruction_sequence is an instruction sequence
Original file line number Diff line number Diff line change @@ -56,9 +56,7 @@ class MSpecScript
56
56
]
57
57
58
58
set :core , [
59
- "spec/ruby/core" ,
60
-
61
- "^spec/ruby/core/tracepoint" ,
59
+ "spec/ruby/core"
62
60
]
63
61
64
62
set :library , [
You can’t perform that action at this time.
0 commit comments