Sha256: 49af26c2a6538e1a525f1dcb8432880d24ad85325f79e079fc3c34d6e6b07331

Contents?: true

Size: 1.06 KB

Versions: 45

Compression:

Stored size: 1.06 KB

Contents

describe Ufo::Ship do
  let(:options) do
    {
      noop: true,
      mute: true,
      wait: false,
      task_definition: service,
      stop_old_tasks: false,
    }
  end
  let(:service) { "demo-web-prod" }
  let(:ship) do
    ship = Ufo::Ship.new(service, options)
    allow(ship).to receive(:ecs).and_return(ecs_client)
    ship
  end

  context "demo-web-prod service" do
    it "should create or update service" do
      allow(ship).to receive(:deploy_stack)

      ship.deploy

      expect(ship).to have_received(:deploy_stack)
    end
  end

  # mocks
  def ecs_client
    ecs = double("ecs")
    allow(ecs).to receive(:describe_clusters).and_return(ecs_describe_clusters)
    ecs
  end

  # ensure_cluster_exist calls this and this makes sure that the cluster 'exists'
  def ecs_describe_clusters
    describe_clusters = double("ecs-describe-clusters")
    cluster1 = OpenStruct.new(status: "ACTIVE")
    allow(describe_clusters).to receive(:clusters).and_return([cluster1])
    describe_clusters
  end

  def ecs_service(name)
    OpenStruct.new(service_name: name)
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
ufo-5.0.7 spec/lib/ship_spec.rb
ufo-5.0.6 spec/lib/ship_spec.rb
ufo-5.0.5 spec/lib/ship_spec.rb
ufo-5.0.4 spec/lib/ship_spec.rb
ufo-5.0.3 spec/lib/ship_spec.rb
ufo-5.0.2 spec/lib/ship_spec.rb
ufo-5.0.1 spec/lib/ship_spec.rb
ufo-5.0.0 spec/lib/ship_spec.rb
ufo-4.6.3 spec/lib/ship_spec.rb
ufo-4.6.2 spec/lib/ship_spec.rb
ufo-4.6.1 spec/lib/ship_spec.rb
ufo-4.6.0 spec/lib/ship_spec.rb
ufo-4.5.11 spec/lib/ship_spec.rb
ufo-4.5.10 spec/lib/ship_spec.rb
ufo-4.5.9 spec/lib/ship_spec.rb
ufo-4.5.8 spec/lib/ship_spec.rb
ufo-4.5.7 spec/lib/ship_spec.rb
ufo-4.5.6 spec/lib/ship_spec.rb
ufo-4.5.5 spec/lib/ship_spec.rb
ufo-4.5.4 spec/lib/ship_spec.rb