Sha256: 504856927f2de3c8b19b2b3bc39f520e5a407ebc793b979ee551c7c3fcb82331
Contents?: true
Size: 1.36 KB
Versions: 11
Compression:
Stored size: 1.36 KB
Contents
#!/usr/bin/env ruby require 'test/unit' require 'rbconfig' # require 'ruby-debug'; Debugger.start # Test Debugger.init and setting up ruby-debug variables class TestDebuggerInit < Test::Unit::TestCase @@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless defined?(@@SRC_DIR) require File.join(@@SRC_DIR, 'helper') def test_basic debugger_output = 'test-init.out' Dir.chdir(@@SRC_DIR) do old_emacs = ENV['EMACS'] old_columns = ENV['COLUMNS'] ENV['EMACS'] = nil ENV['COLUMNS'] = '120' ruby = "#{TestHelper.load_ruby} #{TestHelper.load_params}" IO.popen("#{ruby} ./gcd-dbg.rb 5 >#{debugger_output}", 'w') do |pipe| pipe.puts 'p Debugger::PROG_SCRIPT' pipe.puts 'show args' pipe.puts 'quit unconditionally' end lines = File.open(debugger_output).readlines ENV['EMACS'] = old_emacs ENV['COLUMNS'] = old_columns right_file = case Config::CONFIG['host_os'] when /^darwin/ 'test-init-osx.right' when /^cygwin/ 'test-init-cygwin.right' else 'test-init.right' end expected = File.open(File.join('data', right_file)).readlines assert_equal(expected, lines) File.delete(debugger_output) if expected == lines end end end
Version data entries
11 entries across 11 versions & 1 rubygems