Sha256: d2a7b30deba857abd9d7b73ccf9a3a1ae51247e9179293b7af6576ec8e768ff6

Contents?: true

Size: 929 Bytes

Versions: 3

Compression:

Stored size: 929 Bytes

Contents

describe AwsEc2::CLI do
  before(:all) do
    @args = "--noop"
  end

  describe "aws-ec2" do
    it "create" do
      out = execute("exe/aws-ec2 create server #{@args}")
      expect(out).to include("Creating EC2 instance")
    end

    it "ami" do
      out = execute("exe/aws-ec2 ami myimage #{@args}")
      expect(out).to include("Creating EC2 instance")
    end

    it "wait ami" do
      out = execute("exe/aws-ec2 wait ami myimage")
      expect(out).to include("Waiting for")
    end

    commands = {
      "am" => "ami",
      "compile" => "--profile",
      "create -" =>  "--profile",
      "create" => "name",
      "create name --" => "--profile",
    }
    commands.each do |command, expected_word|
      it "completion #{command}" do
        out = execute("exe/aws-ec2 completion #{command}")
        expect(out).to include(expected_word) # only checking for one word for simplicity
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aws-ec2-1.2.2 spec/lib/cli_spec.rb
aws-ec2-1.2.1 spec/lib/cli_spec.rb
aws-ec2-1.2.0 spec/lib/cli_spec.rb