Sha256: 258e2c605a487a47b9563d0f49d27c2a9079c0c8f5717be6c8837a16d51c62b8

Contents?: true

Size: 855 Bytes

Versions: 1

Compression:

Stored size: 855 Bytes

Contents

describe Balancer::OptionTransformer do
  let(:create) { Balancer::OptionTransformer.new }

  context '#to_cli' do
    it "target group" do
      options = {
        port: 80,
        protocol: "HTTP",
        load_balancer_arn: "load_balancer_arn",
        default_actions: [{type: "forward", target_group_arn: "target_group_arn"}],
      }
      text = create.to_cli(options)
      # puts text
      expect(text).to eq "--port 80 --protocol HTTP --load-balancer-arn load_balancer_arn --default-actions Type=forward,TargetGroupArn=target_group_arn"
    end

    it "tags" do
      options = {
        resource_arns: %w[arn1 arn2],
        tags: [{ key: "balancer", value: "test-elb" }]
      }
      text = create.to_cli(options)
      # puts text
      expect(text).to eq "--resource-arns arn1 arn2 --tags Key=balancer,Value=test-elb"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
balancer-0.2.0 spec/lib/option_transformer_spec.rb