Sha256: 56c22a21ce3144b7a84ec8b925ad8aa6fa4cc5b0a72b2c167d716f9b739d7c82

Contents?: true

Size: 847 Bytes

Versions: 58

Compression:

Stored size: 847 Bytes

Contents

require_relative "../../spec_helper"
require "kontena/main_command"

describe Kontena::MainCommand do

  let(:subject) { described_class.new(File.basename($0)) }
  describe '#subcommand_missing' do
    it 'suggests plugin install for known plugin commands' do
      expect(subject).to receive(:known_plugin_subcommand?).with('testplugin').and_return(true)
      expect(subject).to receive(:exit_with_error).with(/plugin has not been installed/).and_raise(StandardError)
      expect{subject.run(['testplugin', 'master', 'create'])}.to raise_error(StandardError)
    end

    it 'runs normal error handling for unknown sub commands' do
      expect(subject).to receive(:known_plugin_subcommand?).with('testplugin').and_return(false)
      expect{subject.run(['testplugin', 'master', 'create'])}.to raise_error(Clamp::UsageError)
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
kontena-cli-1.1.6 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.5 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.5.rc3 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.5.rc2 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.5.rc1 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.4 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.3 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.2 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.2.rc2 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.2.rc1 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.1 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.1.rc1 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.0 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.0.rc2 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.0.rc1 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.1.0.pre1 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.0.6 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.0.6.rc1 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.0.5 spec/kontena/cli/main_command_spec.rb
kontena-cli-1.0.5.rc1 spec/kontena/cli/main_command_spec.rb