File: basic_test.rb

package info (click to toggle)
ruby-debug-inspector 1.1.0%2Bgh-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 144 kB
  • sloc: ansic: 90; ruby: 68; sh: 4; makefile: 4
file content (33 lines) | stat: -rw-r--r-- 812 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require "test_helper"

class BasicTest < Minitest::Test
  def test_version
    assert(RubyVM::DebugInspector::VERSION)
  end

  def test_backtrace_locations
    RubyVM::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__")
    end
  end

  def test_frame_class
    RubyVM::DebugInspector.open do |dc|
      assert_equal self.class, dc.frame_class(1)
    end
  end

  def test_frame_iseq
    RubyVM::DebugInspector.open do |dc|
      assert_equal __FILE__, dc.frame_iseq(1).path
    end
  end
end