Sha256: dec1a08fcbc2d3890bbb27abb6b1c340f54db61e18d4c5ed8b93c6582739621e

Contents?: true

Size: 1.05 KB

Versions: 13

Compression:

Stored size: 1.05 KB

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

    it "clean ami" do
      out = execute("exe/aws-ec2 clean ami imagebasename")
      expect(out).to include("Cleaning out old AMIs")
    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

13 entries across 13 versions & 1 rubygems

Version Path
aws-ec2-1.4.9 spec/lib/cli_spec.rb
aws-ec2-1.4.8 spec/lib/cli_spec.rb
aws-ec2-1.4.7 spec/lib/cli_spec.rb
aws-ec2-1.4.6 spec/lib/cli_spec.rb
aws-ec2-1.4.5 spec/lib/cli_spec.rb
aws-ec2-1.4.4 spec/lib/cli_spec.rb
aws-ec2-1.4.3 spec/lib/cli_spec.rb
aws-ec2-1.4.2 spec/lib/cli_spec.rb
aws-ec2-1.4.1 spec/lib/cli_spec.rb
aws-ec2-1.4.0 spec/lib/cli_spec.rb
aws-ec2-1.3.2 spec/lib/cli_spec.rb
aws-ec2-1.3.1 spec/lib/cli_spec.rb
aws-ec2-1.3.0 spec/lib/cli_spec.rb