Sha256: 97925a261372e9694192065d897499ca2d20c66cb1ce6a295a26783377b93898

Contents?: true

Size: 967 Bytes

Versions: 10

Compression:

Stored size: 967 Bytes

Contents

#!/usr/bin/env ruby
require_relative './mock-helper'
require_relative '../../processor/command/source'

# Test command source
class TestCommandSource < Test::Unit::TestCase

  include MockUnitHelper
  def setup
    @name = File.basename(__FILE__, '.rb').split(/-/)[2]
    common_setup(@name)
  end

  def test_source_opts

  [['--quiet',       :verbose, false],
   ['-q',            :quiet, true],
   ['--no-quiet',    :quiet, false],
   ['--continue',    :abort_on_error, false],
   ['--no-continue', :abort_on_error, true],
   ['-c',            :abort_on_error, false],
   ['-v',            :verbose, true],
   ['--verbose',     :verbose, true],
   ['--no-verbose',  :verbose, false]
  ].each do |opt, key, expect|
      options = 
        @cmd.parse_options(Trepan::Command::SourceCommand::DEFAULT_OPTIONS.dup,
                           opt)
      assert_equal(expect, options[key], 
                   "Option #{opt} using key #{key} failure")
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
trepanning-2.15.35 test/unit/test-cmd-source.rb
trepanning-1.93.35 test/unit/test-cmd-source.rb
trepanning-2.15.33 test/unit/test-cmd-source.rb
trepanning-1.93.32 test/unit/test-cmd-source.rb
trepanning-0.1.6 test/unit/test-cmd-source.rb
trepanning-0.1.4 test/unit/test-cmd-source.rb
trepanning-0.1.3 test/unit/test-cmd-source.rb
trepanning-0.1.2 test/unit/test-cmd-source.rb
trepanning-0.1.1 test/unit/test-cmd-source.rb
trepanning-0.1.0 test/unit/test-cmd-source.rb