
IMPORTANT: The file content has been truncated.
Status: Showing lines 3351-3450 of 3503 total lines.
Action: To read more of the file, you can use the 'offset' and 'limit' parameters in a subsequent 'read_file' call. For example, to read the next section of the file, use offset: 3450.

--- FILE CONTENT (truncated) ---
      allow(Helper).to receive(:run!).with(cluster1_validate_cmd_staging_shared_loadbalancer)
      allow(Helper).to receive(:run!).with(cluster1_plan_cmd_production_shared_loadbalancer)
      allow(Helper).to receive(:run!).with(cluster1_plan_cmd_staging_shared_loadbalancer)

      allow(Helper).to receive(:run!).with(cluster2_validate_cmd_production)
      allow(Helper).to receive(:run!).with(cluster2_validate_cmd_staging)
      allow(Helper).to receive(:run!).with(cluster2_plan_cmd_production)
      allow(Helper).to receive(:run!).with(cluster2_plan_cmd_staging)

      allow(Helper).to receive(:run!).with(cluster3_validate_cmd_staging)
      allow(Helper).to receive(:run!).with(cluster3_plan_cmd_staging)

      allow(Helper).to receive(:run!).with(cluster4_validate_cmd_production)
      allow(Helper).to receive(:run!).with(cluster4_plan_cmd_production)

      Infrastructure.new(
        ConfigurationReader.new(path: "./dalmatian.yml.example", parameter_store: fake_parameter_store).infrastructures
      ).test
    end

    it 'invokes  "terraform validate" with the expected cluster options' do
      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_hz)

      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_s3)

      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_vpn_cg)

      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_production).twice
      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_staging).twice

      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_production_waf)
      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_staging_waf)

      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_production_rds)
      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_staging_rds)

      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_production_elasticache_cluster)
      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_staging_elasticache_cluster)

      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_production_opensearch_cluster)
      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_staging_opensearch_cluster)

      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_production_service)
      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_staging_service)

      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_production_shared_loadbalancer)
      expect(Helper).to have_received(:run!).with(cluster1_validate_cmd_staging_shared_loadbalancer)

      expect(Helper).to have_received(:run!).with(cluster2_validate_cmd_production)
      expect(Helper).to have_received(:run!).with(cluster2_validate_cmd_staging)

      expect(Helper).to have_received(:run!).with(cluster3_validate_cmd_staging)

      expect(Helper).to have_received(:run!).with(cluster4_validate_cmd_production)
    end

    it 'invokes  "terraform validate" with the expected source options' do
      expect(Helper).to have_received(:run!).with(source1_validate_cmd_production).twice
      expect(Helper).to have_received(:run!).with(source1_validate_cmd_staging).twice
    end

    describe 'use of "terraform plan"' do
      it 'passes the hosted zone config to "terraform plan"' do
        aggregate_failures do
          expect(Helper).to have_received(:run!).with(cluster1_plan_cmd_hz)
        end
      end

      it 'passes the s3 config to "terraform plan"' do
        aggregate_failures do
          expect(Helper).to have_received(:run!).with(cluster1_plan_cmd_s3)
        end
      end

      it 'passes the vpn customer gateway config to "terraform plan"' do
        aggregate_failures do
          expect(Helper).to have_received(:run!).with(cluster1_plan_cmd_vpn_cg)
        end
      end

      it 'passes the base config to "terraform plan"' do
        aggregate_failures do
          expect(Helper).to have_received(:run!).with(cluster1_plan_cmd_production).twice
          expect(Helper).to have_received(:run!).with(cluster1_plan_cmd_staging).twice
        end
      end

      it 'passes the waf config to "terraform plan"' do
        aggregate_failures do
          expect(Helper).to have_received(:run!).with(cluster1_plan_cmd_production_waf)
          expect(Helper).to have_received(:run!).with(cluster1_plan_cmd_staging_waf)
        end
      end

      it 'passes the rds config to "terraform plan"' do
        aggregate_failures do
          expect(Helper).to have_received(:run!).with(cluster1_plan_cmd_production_rds)
          expect(Helper).to have_received(:run!).with(cluster1_plan_cmd_staging_rds)
        end
      end