PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/gems/ruby-debug-0.10.2/test/test-frame.rb

https://github.com/technicalpickles/flockup
Ruby | 34 lines | 22 code | 5 blank | 7 comment | 0 complexity | ff7522402c4862f5952d7e2c84485add MD5 | raw file
Possible License(s): GPL-2.0
  1. #!/usr/bin/env ruby
  2. require 'test/unit'
  3. # require 'rubygems'
  4. # require 'ruby-debug'; Debugger.start(:post_mortem => true)
  5. # Test frame commands
  6. class TestFrame < Test::Unit::TestCase
  7. @@SRC_DIR = File.dirname(__FILE__) unless
  8. defined?(@@SRC_DIR)
  9. require File.join(@@SRC_DIR, 'helper')
  10. include TestHelper
  11. # Test commands in frame.rb
  12. def test_basic
  13. testname='frame'
  14. # Ruby 1.8.6 and earlier have a trace-line number bug for return
  15. # statements.
  16. filter = Proc.new{|got_lines, correct_lines|
  17. [got_lines[11], got_lines[11]].flatten.each do |s|
  18. s.sub!(/in file ".*gcd.rb/, 'in file "gcd.rb')
  19. end
  20. }
  21. Dir.chdir(@@SRC_DIR) do
  22. script = File.join('data', testname + '.cmd')
  23. assert_equal(true,
  24. run_debugger(testname,
  25. "--script #{script} -- gcd.rb 3 5",
  26. nil, filter))
  27. end
  28. end
  29. end