Sha256: f2f8880eb0fc32c703d9c4da19f4816c9fe49c7aa5304b98901a116650a05b6c

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

#!/usr/bin/env ruby
require File.expand_path("../../../helper", __FILE__)

class TestCatchCommand < Test::Unit::TestCase
  class MockState
    attr_accessor :message 
    def context; end
    def confirm(msg); true end
    def print(*args)
      @message = *args
    end
  end
  
  # regression test for bug #20156
  def test_catch_does_not_blow_up
    state = MockState.new
    catch_cmd = Debugger::CatchCommand.new(state)
    assert(catch_cmd.match('catch off'))
    catch(:debug_error) do
      catch_cmd.execute
    end
    assert_equal(nil, state.message)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-debug-0.10.5.rc1 test/cli/commands/catchpoint_test.rb