Sha256: 0c2a879b47af792a425843e38f07b4fc5d96f9e2b1a41729c7f2e8153019886c

Contents?: true

Size: 887 Bytes

Versions: 1

Compression:

Stored size: 887 Bytes

Contents

#!/usr/bin/env ruby
require 'test/unit'
require_relative '../../app/breakpoint'
require 'thread_frame'

class TestAppBrkpt < Test::Unit::TestCase

  def test_basic
    tf = RubyVM::ThreadFrame.current
    iseq = tf.iseq
    b1 = Trepan::Breakpoint.new(iseq, 0)
    assert_equal(false, b1.temp?)
    assert_equal(0, b1.hits)
    assert_equal('B', b1.icon_char)
    assert_equal(true, b1.condition?(tf.binding))
    assert_equal(1, b1.hits)
    assert_equal(b1.source_container, tf.source_container)
    b1.enabled = false
    assert_equal('b', b1.icon_char)
    assert_raises TypeError do 
      Trepan::Breakpoint.new(iseq, iseq.iseq_size, :temp => true)
    end
    assert_raises TypeError do 
      Trepan::Breakpoint.new(0, 5)
    end
    require_relative '../../lib/trepanning.rb'
    b2 = Trepan::Breakpoint.new(iseq, 0, :temp => true)
    assert_equal('t', b2.icon_char)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trepanning-0.1.0 test/unit/test-app-brkpt.rb