Sha256: 003883e0cdb548cd6298c58b01cf732943ef55f100810caded68edf148e035d1
Contents?: true
Size: 1.22 KB
Versions: 83
Compression:
Stored size: 1.22 KB
Contents
require_relative "../../../spec_helper" require "kontena/cli/services/containers_command" describe Kontena::Cli::Services::ContainersCommand do include ClientHelpers describe '#execute' do before(:each) do allow(client).to receive(:get).and_return({ 'containers' => [] }) end it 'requires api url' do expect(subject).to receive(:require_api_url).once subject.run(['service-a']) end it 'requires token' do expect(subject).to receive(:require_token).and_return(token) subject.run(['service-a']) end it 'to not throw on missing "overlay_cidr" property' do allow(client).to receive(:get).and_return({ 'containers' => [ {'id' => "service-a-id", 'node' => {'public_ip' => ""}} ] }) expect { subject.run(['service-a']) }.to_not raise_error(NoMethodError) end it 'to not throw on nil "overlay_cidr" property' do allow(client).to receive(:get).and_return({ 'containers' => [ {'id' => "service-a-id", 'node' => {'public_ip' => ""}, 'overlay_cidr' => nil} ] }) expect { subject.run(['service-a']) }.to_not raise_error(NoMethodError) end end end
Version data entries
83 entries across 83 versions & 1 rubygems