start a ruby version of aws-ha-release

- use aruba to test command line options
  - use rspec to unit test
This commit is contained in:
Anuj Biyani
2013-05-30 13:35:37 -07:00
parent 64e840e711
commit 179a788fe3
7 changed files with 124 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
Feature: AWS High-Availibility Release
Scenario: Requires the autoscaling group name to be passed in
When I run `aws-ha-release.rb`
Then the output should contain "You must specify the AutoScaling Group Name: aws-ha-release.rb -a <group name>"
And the exit status should not be 0
When I run `aws-ha-release.rb -a test_group`
Then the exit status should be 0
When I run `aws-ha-release.rb --as-group-name test_group`
Then the exit status should be 0
Scenario: Optionally allows the user to specify an ELB timeout
When I run `aws-ha-release.rb -a test_group -t not_valid_input`
Then the exit status should not be 0
When I run `aws-ha-release.rb -a test_group -t 100`
Then the exit status should be 0
When I run `aws-ha-release.rb -a test_group --elb-timeout 100`
Then the exit status should be 0
Scenario: Optionally allows the user to specify a region
When I run `aws-ha-release.rb -a test_group -r`
Then the exit status should not be 0
When I run `aws-ha-release.rb -a test_group -r test_region`
Then the exit status should be 0
When I run `aws-ha-release.rb -a test_group --region test_region`
Then the exit status should be 0
Scenario: Optionally allows the user to specify an inservice time allowed
When I run `aws-ha-release.rb -a test_group -i not_valid_input`
Then the exit status should not be 0
When I run `aws-ha-release.rb -a test_group -i 100`
Then the exit status should be 0
When I run `aws-ha-release.rb -a test_group --inservice-time-allowed 100`
Then the exit status should be 0
Scenario: Optionally allows the user to pass in the aws_access_key and aws_secret_key
When I run `aws-ha-release.rb -a test_group -o testaccesskey`
Then the exit status should not be 0
When I run `aws-ha-release.rb -a test_group -o testaccesskey -s testsecretkey`
Then the exit status should be 0
When I run `aws-ha-release.rb -a test_group --aws-access-key testaccesskey --aws-secret-key testsecretkey`
Then the exit status should be 0

3
features/support/env.rb Normal file
View File

@@ -0,0 +1,3 @@
require 'aruba/cucumber'
ENV['PATH'] = "#{Dir.pwd}/aws-ha-release#{File::PATH_SEPARATOR}#{ENV['PATH']}"