Sha256: 52113351d1511c365d03beb59b9c912b34cfd770b40a4c8f0182e998e7226b4b
Contents?: true
Size: 1.6 KB
Versions: 7
Compression:
Stored size: 1.6 KB
Contents
require_relative "../../../spec_helper" require "kontena/cli/apps/build_command" describe Kontena::Cli::Apps::BuildCommand do include FixturesHelpers let(:subject) do described_class.new(File.basename($0)) end let(:kontena_yml) do fixture('kontena.yml') end let(:docker_compose_yml) do fixture('docker-compose.yml') end let(:settings) do {'current_server' => 'alias', 'servers' => [ { 'name' => 'some_master', 'url' => 'some_master' } ] } end describe '#execute' do before(:each) do allow(subject).to receive(:settings).and_return(settings) allow(subject).to receive(:current_dir).and_return("kontena-test") allow(File).to receive(:exists?).and_return(true) allow(File).to receive(:read).with("#{Dir.getwd}/kontena.yml").and_return(kontena_yml) allow(File).to receive(:read).with("#{Dir.getwd}/docker-compose.yml").and_return(docker_compose_yml) end it 'requests process_docker_images with services from yaml' do expect(subject).to receive(:process_docker_images) do |services, force_build, no_cache| expect(services.keys).to eq(['wordpress', 'mysql']) end subject.run([]) end it 'requests process_docker_images with force_build' do expect(subject).to receive(:process_docker_images).with(anything, true, anything) subject.run([]) end it 'requests process_docker_images with given no_cache option' do expect(subject).to receive(:process_docker_images).with(anything, anything, true) subject.run(['--no-cache', true]) end end end
Version data entries
7 entries across 7 versions & 1 rubygems