Sha256: 5a61537791d5320f700f978f9b0da700ac5cb2d669cd426da28f83dfe34cbfb2

Contents?: true

Size: 1 KB

Versions: 6

Compression:

Stored size: 1 KB

Contents

#!/usr/bin/env ruby
require 'test/unit'
require_relative '../../processor/command'

class Trepan::Command::Test < Trepan::Command
  NAME = 'test'
  CATEGORY = 'testcategory'
  completion %w(a aa ab ba aac)
end

class TestBaseCommand < Test::Unit::TestCase

  class MockCmdProcessor
    # The below functions aren't tested/called, but they are the
    # methods required by a command and are placeholders for when we
    # do start testing.
    def initialize(dbgr)
    end
    def confirm(message, default)
      p ['confirm: ', message, default]
    end
    def errmsg(message, opts)
      p ['err:', message, opts]
    end
    def msg(message, opts)
      p [message, opts]
    end
    def msg_nocr(message, opts)
      p ['nocr: ', message, opts]
    end
    def section(message, opts)
      p ['section: ', message, opts]
    end
  end

  def setup
    @proc = MockCmdProcessor.new(nil)
    @cmd = Trepan::Command::Test.new(@proc)
  end

  def test_base_completion
    assert_equal(%w(aa aac), @cmd.complete('aa'))
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
trepanning-2.15.35 test/unit/test-command.rb
trepanning-1.93.35 test/unit/test-command.rb
trepanning-2.15.33 test/unit/test-command.rb
trepanning-1.93.32 test/unit/test-command.rb
trepanning-0.1.6 test/unit/test-command.rb
trepanning-0.1.4 test/unit/test-command.rb