Sha256: f6edf8e4da797f9d276a3339d007bc133c20ce9766e0bd01a2e2ce87724277b1

Contents?: true

Size: 535 Bytes

Versions: 4

Compression:

Stored size: 535 Bytes

Contents

require_relative "test_helper"

class CompoundCommandFinderTest < MiniTest::Test
  include TestHelper

  def test_exception_for_missing_commands
    @name = "new"
    @unknown_name = "create"
    @existing_command = OpenStruct.new(:name => @name)
    @base = OpenStruct.new( :commands => { @name => @existing_command })

    @code = lambda { GLI::Commands::CompoundCommand.new(@base,{:foo => [@name,@unknown_name]}) }

    ex = assert_raises(RuntimeError,&@code)
    assert_match /#{Regexp.escape(@unknown_name)}/,ex.message
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gli-2.21.1 test/unit/compound_command_test.rb
gli-2.21.0 test/unit/compound_command_test.rb
gli-2.20.1 test/unit/compound_command_test.rb
gli-2.20.0 test/unit/compound_command_test.rb