-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename RubyVM::DebugInspector to DebugInspector and add support for t…
…ruffleruby * Fixes #36 * Also update CI.
- Loading branch information
Showing
9 changed files
with
67 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/rubyvm/debug_inspector/version.rb → lib/debug_inspector/version.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class RubyVM::DebugInspector | ||
class DebugInspector | ||
# Don't forget to update the version string in the gemspec file. | ||
VERSION = "1.1.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,59 @@ | ||
require "test_helper" | ||
|
||
class BasicTest < MiniTest::Test | ||
def setup | ||
@offset = DebugInspector.open do |dc| | ||
dc.backtrace_locations.index { |loc| loc.path == __FILE__ and loc.label == "setup" } | ||
end | ||
end | ||
|
||
def test_version | ||
assert(RubyVM::DebugInspector::VERSION) | ||
assert(DebugInspector::VERSION) | ||
end | ||
|
||
def test_legacy_name | ||
if RUBY_ENGINE == "ruby" | ||
if RubyVM.respond_to?(:deprecate_constant) | ||
warning = /warning: constant RubyVM::DebugInspector is deprecated/ | ||
else | ||
warning = '' | ||
end | ||
|
||
assert_output('', warning) do | ||
assert_same DebugInspector, RubyVM::DebugInspector | ||
end | ||
else | ||
assert !defined?(RubyVM::DebugInspector) | ||
end | ||
end | ||
|
||
def test_backtrace_locations | ||
RubyVM::DebugInspector.open do |dc| | ||
DebugInspector.open do |dc| | ||
assert dc.backtrace_locations.size > 0 | ||
dc.backtrace_locations.each{|e| assert_instance_of Thread::Backtrace::Location, e} | ||
end | ||
end | ||
|
||
def test_frame_binding | ||
RubyVM::DebugInspector.open do |dc| | ||
assert_equal self, dc.frame_binding(1).eval("self") | ||
assert_equal __method__, dc.frame_binding(1).eval("__method__") | ||
DebugInspector.open do |dc| | ||
assert_equal self, dc.frame_binding(@offset).eval("self") | ||
assert_equal __method__, dc.frame_binding(@offset).eval("__method__") | ||
end | ||
end | ||
|
||
def test_frame_class | ||
RubyVM::DebugInspector.open do |dc| | ||
assert_equal self.class, dc.frame_class(1) | ||
DebugInspector.open do |dc| | ||
assert_equal self.class, dc.frame_class(@offset) | ||
end | ||
end | ||
|
||
def test_frame_iseq | ||
RubyVM::DebugInspector.open do |dc| | ||
assert_equal __FILE__, dc.frame_iseq(1).path | ||
DebugInspector.open do |dc| | ||
if RUBY_ENGINE == "ruby" | ||
assert_equal __FILE__, dc.frame_iseq(@offset).path | ||
else | ||
assert_nil dc.frame_iseq(@offset) | ||
end | ||
end | ||
end | ||
end |