Sha256: e156b4f238c08d2feab91712f36d4c6cf39fc9ef4ca11d421c82b025d2b21318

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

#!/usr/bin/env ruby
require 'test/unit'

# Test Trepan::CmdProcessor::Default
class TestProcDefault < Test::Unit::TestCase

  DIR = File.dirname(__FILE__)
  DEFAULT_RBFILE = File.join(%W(#{DIR} .. .. processor default.rb))

  def test_maxwidth_setting
    ENV['COLUMNS'] = '50'
    Trepan::CmdProcessor.send(:remove_const, 'DEFAULT_SETTINGS') if
      Trepan::CmdProcessor.const_defined?('DEFAULT_SETTINGS')
    load DEFAULT_RBFILE
    assert_equal(50, Trepan::CmdProcessor::DEFAULT_SETTINGS[:maxwidth],
                 'Pick up COLUMNS environment')

    Trepan::CmdProcessor.send(:remove_const, 'DEFAULT_SETTINGS')
    load DEFAULT_RBFILE

    ENV['COLUMNS'] = '0'
    assert_operator(Trepan::CmdProcessor::DEFAULT_SETTINGS[:maxwidth],
                    :>=, 10,
                 'Change too small COLUMNS environment value')

    Trepan::CmdProcessor.send(:remove_const, 'DEFAULT_SETTINGS')
    load DEFAULT_RBFILE

    ENV['COLUMNS'] = 'non-numeric-string'
    assert_operator(Trepan::CmdProcessor::DEFAULT_SETTINGS[:maxwidth],
                    :>=, 10,
                 'Change too small COLUMNS environment value')
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
trepanning-1.93.35 test/unit/test-proc-default.rb
trepanning-1.93.32 test/unit/test-proc-default.rb
rb8-trepanning-0.1.6 test/unit/test-proc-default.rb