Sha256: 0c035170cc9e73ae3ecae4d71cf8d6e864358709439d4fee34ded587a915b6ca
Contents?: true
Size: 1.46 KB
Versions: 36
Compression:
Stored size: 1.46 KB
Contents
require 'kontena/cli/containers/exec_command' describe Kontena::Cli::Containers::ExecCommand do include ClientHelpers it 'executes with defaults' do expect(subject).to receive(:container_exec).with('test-grid/host/test-service-1', [ 'test' ], interactive: false, shell: false, tty: false, ) { 0 } subject.run(['host/test-service-1', 'test']) end it 'executes with --shell' do expect(subject).to receive(:container_exec).with('test-grid/host/test-service-1', [ 'echo', '$HOSTNAME' ], interactive: false, shell: true, tty: false, ) { 0 } subject.run(['--shell', 'host/test-service-1', 'echo', '$HOSTNAME']) end it 'executes with -i' do expect(subject).to receive(:container_exec).with('test-grid/host/test-service-1', [ 'test' ], interactive: true, shell: false, tty: false, ) { 0 } subject.run(['-i', 'host/test-service-1', 'test']) end it 'executes with -it' do expect(subject).to receive(:container_exec).with('test-grid/host/test-service-1', [ 'test' ], interactive: true, shell: false, tty: true, ) { 0 } subject.run(['-it', 'host/test-service-1', 'test']) end it 'fails on error' do expect(subject).to receive(:container_exec).with('test-grid/host/test-service-1', [ 'test' ], interactive: false, shell: false, tty: false, ) { 1 } expect{subject.run(['host/test-service-1', 'test'])}.to exit_with_error end end
Version data entries
36 entries across 36 versions & 1 rubygems