mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@35a9fba
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
58573c33e4
commit
6204e0804b
147 changed files with 2728 additions and 21522 deletions
22
spec/ruby/core/tracepoint/eval_script_spec.rb
Normal file
22
spec/ruby/core/tracepoint/eval_script_spec.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
ruby_version_is "2.6" do
|
||||
describe "#eval_script" do
|
||||
ScratchPad.record []
|
||||
|
||||
script = <<-CODE
|
||||
def foo
|
||||
p :hello
|
||||
end
|
||||
CODE
|
||||
|
||||
TracePoint.new(:script_compiled) do |e|
|
||||
ScratchPad << e.eval_script
|
||||
end.enable do
|
||||
eval script
|
||||
end
|
||||
|
||||
ScratchPad.recorded.should == [script]
|
||||
end
|
||||
end
|
23
spec/ruby/core/tracepoint/instruction_sequence_spec.rb
Normal file
23
spec/ruby/core/tracepoint/instruction_sequence_spec.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
ruby_version_is "2.6" do
|
||||
describe "#instruction_sequence" do
|
||||
ScratchPad.record []
|
||||
|
||||
script = <<-CODE
|
||||
def foo
|
||||
p :hello
|
||||
end
|
||||
CODE
|
||||
|
||||
TracePoint.new(:script_compiled) do |e|
|
||||
ScratchPad << e.instruction_sequence
|
||||
end.enable do
|
||||
eval script
|
||||
end
|
||||
|
||||
ScratchPad.recorded.size.should == 1
|
||||
ScratchPad.recorded[0].class.should == RubyVM::InstructionSequence
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue