automan 2.3.5 → 2.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -5
  3. data/automan.gemspec +3 -3
  4. data/lib/automan.rb +0 -1
  5. data/lib/automan/base.rb +3 -7
  6. data/lib/automan/beanstalk/deployer.rb +1 -1
  7. data/lib/automan/beanstalk/package.rb +1 -1
  8. data/lib/automan/beanstalk/router.rb +1 -1
  9. data/lib/automan/cli/snapper.rb +23 -3
  10. data/lib/automan/cli/stacker.rb +0 -19
  11. data/lib/automan/cloudformation/launcher.rb +3 -6
  12. data/lib/automan/cloudformation/replacer.rb +1 -1
  13. data/lib/automan/cloudformation/terminator.rb +1 -1
  14. data/lib/automan/ec2/image.rb +3 -3
  15. data/lib/automan/mixins/aws_caller.rb +7 -21
  16. data/lib/automan/rds/snapshot.rb +25 -35
  17. data/lib/automan/s3/downloader.rb +1 -10
  18. data/lib/automan/version.rb +1 -1
  19. data/spec/beanstalk/application_spec.rb +17 -17
  20. data/spec/beanstalk/configuration_spec.rb +24 -24
  21. data/spec/beanstalk/deployer_spec.rb +65 -65
  22. data/spec/beanstalk/router_spec.rb +19 -18
  23. data/spec/beanstalk/terminator_spec.rb +16 -16
  24. data/spec/beanstalk/uploader_spec.rb +13 -13
  25. data/spec/beanstalk/version_spec.rb +10 -8
  26. data/spec/cloudformation/launcher_spec.rb +65 -63
  27. data/spec/cloudformation/replacer_spec.rb +10 -10
  28. data/spec/cloudformation/terminator_spec.rb +23 -23
  29. data/spec/cloudformation/uploader_spec.rb +13 -13
  30. data/spec/ec2/image_spec.rb +55 -55
  31. data/spec/ec2/instance_spec.rb +17 -17
  32. data/spec/mixins/aws_caller_spec.rb +9 -9
  33. data/spec/mixins/utils_spec.rb +28 -27
  34. data/spec/rds/snapshot_spec.rb +46 -44
  35. metadata +9 -22
  36. data/.ruby-gemset +0 -1
  37. data/.ruby-version +0 -1
  38. data/.travis.yml +0 -5
  39. data/lib/automan/elasticache/router.rb +0 -79
  40. data/spec/elasticache/router_spec.rb +0 -29
  41. data/templates/stacker/.env.example +0 -14
  42. data/templates/stacker/.gitignore +0 -2
  43. data/templates/stacker/.ruby-gemset.tt +0 -1
  44. data/templates/stacker/.ruby-version +0 -1
  45. data/templates/stacker/Gemfile +0 -4
  46. data/templates/stacker/bin/%app_name%.tt +0 -62
  47. data/templates/stacker/bin/launch_%app_name%.sh.tt +0 -12
@@ -1,11 +1,11 @@
1
1
  require 'automan'
2
2
 
3
3
  describe Automan::Cloudformation::Uploader do
4
- subject() do
4
+ subject(:u) do
5
5
  AWS.stub!
6
6
  u = Automan::Cloudformation::Uploader.new
7
7
  u.logger = Logger.new('/dev/null')
8
- allow(u).to receive(:templates).and_return(%w[a b c])
8
+ u.stub(:templates).and_return(%w[a b c])
9
9
  u
10
10
  end
11
11
 
@@ -16,35 +16,35 @@ describe Automan::Cloudformation::Uploader do
16
16
 
17
17
  describe '#all_templates_valid?' do
18
18
  it "raises error if there are no templates" do
19
- allow(subject).to receive(:templates).and_return([])
19
+ u.stub(:templates).and_return([])
20
20
  expect {
21
- subject.all_templates_valid?
21
+ u.all_templates_valid?
22
22
  }.to raise_error Automan::Cloudformation::NoTemplatesError
23
23
  end
24
24
 
25
25
  it 'returns true if templates are valid' do
26
- expect(subject).to receive(:template_valid?).exactly(3).times.and_return(true)
27
- expect(subject.all_templates_valid?).to be_truthy
26
+ u.should_receive(:template_valid?).exactly(3).times.and_return(true)
27
+ u.all_templates_valid?.should be_true
28
28
  end
29
29
 
30
30
  it 'returns false if any templates are invalid' do
31
- allow(subject).to receive(:template_valid?).and_return(false)
32
- expect(subject.all_templates_valid?).to be_falsey
31
+ u.stub(:template_valid?).and_return(false)
32
+ u.all_templates_valid?.should be_false
33
33
  end
34
34
  end
35
35
 
36
36
  describe '#upload_templates' do
37
37
  it 'raises error if any template fails validation' do
38
- allow(subject).to receive(:all_templates_valid?).and_return(false)
38
+ u.stub(:all_templates_valid?).and_return(false)
39
39
  expect {
40
- subject.upload_templates
40
+ u.upload_templates
41
41
  }.to raise_error(Automan::Cloudformation::InvalidTemplateError)
42
42
  end
43
43
 
44
44
  it 'uploads files if all are valid' do
45
- allow(subject).to receive(:all_templates_valid?).and_return(true)
46
- expect(subject).to receive(:upload_file).exactly(3).times
47
- subject.upload_templates
45
+ u.stub(:all_templates_valid?).and_return(true)
46
+ u.should_receive(:upload_file).exactly(3).times
47
+ u.upload_templates
48
48
  end
49
49
  end
50
50
  end
@@ -2,37 +2,37 @@ require 'automan'
2
2
  require 'logger'
3
3
 
4
4
  describe Automan::Ec2::Image do
5
- it { is_expected.to respond_to :ec2 }
6
- it { is_expected.to respond_to :create }
7
- it { is_expected.to respond_to :prune }
8
- it { is_expected.to respond_to :default_image_name }
9
- it { is_expected.to respond_to :image_snapshot_exists? }
10
- it { is_expected.to respond_to :image_snapshot }
11
- it { is_expected.to respond_to :delete_snapshots }
12
- it { is_expected.to respond_to :is_more_than_month_old? }
5
+ it { should respond_to :ec2 }
6
+ it { should respond_to :create }
7
+ it { should respond_to :prune }
8
+ it { should respond_to :default_image_name }
9
+ it { should respond_to :image_snapshot_exists? }
10
+ it { should respond_to :image_snapshot }
11
+ it { should respond_to :delete_snapshots }
12
+ it { should respond_to :is_more_than_month_old? }
13
13
 
14
14
  describe '#default_image_name' do
15
- subject() do
15
+ subject(:s) do
16
16
  AWS.stub!
17
17
  s = Automan::Ec2::Image.new
18
18
  s.logger = Logger.new('/dev/null')
19
- allow(s).to receive(:name).and_return('skee-lo')
19
+ s.stub(:name).and_return('skee-lo')
20
20
  s
21
21
  end
22
22
 
23
23
  it "never returns nil" do
24
- expect(subject.default_image_name()).to_not be_nil
24
+ s.default_image_name().should_not be_nil
25
25
  end
26
26
 
27
27
  it "returns name dash iso8601 string" do
28
- name = subject.default_image_name()
29
- expect(name).to match /^skee-lo-(\d{4})-(\d{2})-(\d{2})T(\d{2})(\d{2})(\d{2})Z/
28
+ name = s.default_image_name()
29
+ name.should match /^skee-lo-(\d{4})-(\d{2})-(\d{2})T(\d{2})-(\d{2})-(\d{2})[+-](\d{2})-(\d{2})/
30
30
  end
31
31
 
32
32
  end
33
33
 
34
34
  describe '#image_snapshot' do
35
- subject() do
35
+ subject(:s) do
36
36
  AWS.stub!
37
37
  s = Automan::Ec2::Image.new
38
38
  s.logger = Logger.new('/dev/null')
@@ -41,31 +41,31 @@ describe Automan::Ec2::Image do
41
41
 
42
42
  it "returns id if the snapshot exists" do
43
43
  fake_ami = double("ami")
44
- allow(fake_ami).to receive(:block_devices) { [ { ebs: {snapshot_id: 'foo' } } ] }
45
- expect(subject.image_snapshot(fake_ami)).to eq('foo')
44
+ fake_ami.stub(:block_devices) { [ { ebs: {snapshot_id: 'foo' } } ] }
45
+ s.image_snapshot(fake_ami).should eq('foo')
46
46
  end
47
47
 
48
48
  it "returns nil if the snapshot is nil" do
49
49
  fake_ami = double("ami")
50
- allow(fake_ami).to receive(:block_devices) { [ { ebs: {snapshot_id: nil } } ] }
51
- expect(subject.image_snapshot(fake_ami)).to be_nil
50
+ fake_ami.stub(:block_devices) { [ { ebs: {snapshot_id: nil } } ] }
51
+ s.image_snapshot(fake_ami).should be_nil
52
52
  end
53
53
 
54
54
  it "returns nil if the ebs is nil" do
55
55
  fake_ami = double("ami")
56
- allow(fake_ami).to receive(:block_devices) { [ { ebs: nil } ] }
57
- expect(subject.image_snapshot(fake_ami)).to be_nil
56
+ fake_ami.stub(:block_devices) { [ { ebs: nil } ] }
57
+ s.image_snapshot(fake_ami).should be_nil
58
58
  end
59
59
 
60
60
  it "returns nil if the device is nil" do
61
61
  fake_ami = double("ami")
62
- allow(fake_ami).to receive(:block_devices) { [ nil ] }
63
- expect(subject.image_snapshot(fake_ami)).to be_nil
62
+ fake_ami.stub(:block_devices) { [ nil ] }
63
+ s.image_snapshot(fake_ami).should be_nil
64
64
  end
65
65
  end
66
66
 
67
67
  describe '#delete_snapshots' do
68
- subject() do
68
+ subject(:s) do
69
69
  AWS.stub!
70
70
  s = Automan::Ec2::Image.new
71
71
  s.logger = Logger.new('/dev/null')
@@ -74,67 +74,67 @@ describe Automan::Ec2::Image do
74
74
 
75
75
  it 'does not delete snapshots with status != :completed' do
76
76
  snapshot = double(:snapshot)
77
- allow(snapshot).to receive(:status).and_return(:foo)
78
- allow(snapshot).to receive(:id)
79
- expect(snapshot).to_not receive(:delete)
80
- subject.delete_snapshots( [ snapshot ])
77
+ snapshot.stub(:status).and_return(:foo)
78
+ snapshot.stub(:id)
79
+ snapshot.should_not_receive(:delete)
80
+ s.delete_snapshots( [ snapshot ])
81
81
  end
82
82
 
83
83
  it 'deletes snapshots with status == :completed' do
84
84
  snapshot = double(:snapshot)
85
- allow(snapshot).to receive(:status).and_return(:completed)
86
- allow(snapshot).to receive(:id)
87
- expect(snapshot).to receive(:delete)
88
- subject.delete_snapshots( [ snapshot ])
85
+ snapshot.stub(:status).and_return(:completed)
86
+ snapshot.stub(:id)
87
+ snapshot.should_receive(:delete)
88
+ s.delete_snapshots( [ snapshot ])
89
89
  end
90
90
  end
91
91
 
92
92
  describe '#deregister_images' do
93
- subject() do
93
+ subject(:s) do
94
94
  AWS.stub!
95
95
  s = Automan::Ec2::Image.new
96
96
  s.logger = Logger.new('/dev/null')
97
- allow(s).to receive(:image_snapshot).and_return('foo')
97
+ s.stub(:image_snapshot).and_return('foo')
98
98
  s
99
99
  end
100
100
 
101
101
  before(:each) do
102
102
  @image = double(:image)
103
- allow(@image).to receive(:id)
104
- allow(subject).to receive(:my_images).and_return( [ @image ] )
103
+ @image.stub(:id)
104
+ s.stub(:my_images).and_return( [ @image ] )
105
105
  end
106
106
 
107
107
  it 'does not deregister images with state != :available' do
108
- allow(@image).to receive(:state).and_return(:foo)
109
- allow(@image).to receive(:tags).and_return( {'CanPrune' => 'yes'} )
110
- expect(@image).to_not receive(:delete)
111
- subject.deregister_images( [ 'foo' ] )
108
+ @image.stub(:state).and_return(:foo)
109
+ @image.stub(:tags).and_return( {'CanPrune' => 'yes'} )
110
+ @image.should_not_receive(:delete)
111
+ s.deregister_images( [ 'foo' ] )
112
112
  end
113
113
 
114
114
  it 'does not deregister images w/o prunable tag' do
115
- allow(@image).to receive(:state).and_return(:available)
116
- allow(@image).to receive(:tags).and_return( Hash.new )
117
- expect(@image).to_not receive(:delete)
118
- subject.deregister_images( [ 'foo' ] )
115
+ @image.stub(:state).and_return(:available)
116
+ @image.stub(:tags).and_return( Hash.new )
117
+ @image.should_not_receive(:delete)
118
+ s.deregister_images( [ 'foo' ] )
119
119
  end
120
120
 
121
121
  it 'does not deregister images whose snapshots are not in the list' do
122
- allow(@image).to receive(:state).and_return(:available)
123
- allow(@image).to receive(:tags).and_return( {'CanPrune' => 'yes'} )
124
- expect(@image).to_not receive(:delete)
125
- subject.deregister_images( [ 'bar' ] )
122
+ @image.stub(:state).and_return(:available)
123
+ @image.stub(:tags).and_return( {'CanPrune' => 'yes'} )
124
+ @image.should_not_receive(:delete)
125
+ s.deregister_images( [ 'bar' ] )
126
126
  end
127
127
 
128
128
  it 'deletes available, prunable images on the list' do
129
- allow(@image).to receive(:state).and_return(:available)
130
- allow(@image).to receive(:tags).and_return( {'CanPrune' => 'yes'} )
131
- expect(@image).to receive(:delete)
132
- subject.deregister_images( [ 'foo' ] )
129
+ @image.stub(:state).and_return(:available)
130
+ @image.stub(:tags).and_return( {'CanPrune' => 'yes'} )
131
+ @image.should_receive(:delete)
132
+ s.deregister_images( [ 'foo' ] )
133
133
  end
134
134
  end
135
135
 
136
136
  describe '#is_more_than_month_old?' do
137
- subject() do
137
+ subject(:s) do
138
138
  AWS.stub!
139
139
  s = Automan::Ec2::Image.new
140
140
  s.logger = Logger.new('/dev/null')
@@ -142,17 +142,17 @@ describe Automan::Ec2::Image do
142
142
  end
143
143
 
144
144
  it 'returns false if argument is not a Time object' do
145
- expect(subject.is_more_than_month_old?(Object.new)).to be_falsey
145
+ s.is_more_than_month_old?(Object.new).should be_false
146
146
  end
147
147
 
148
148
  it 'returns true if time is more than 30 days in the past' do
149
149
  days_of_yore = Time.now - (60*60*24*30)
150
- expect(subject.is_more_than_month_old?(days_of_yore)).to be_truthy
150
+ s.is_more_than_month_old?(days_of_yore).should be_true
151
151
  end
152
152
 
153
153
  it 'returns false if time is in the last 30 days' do
154
154
  just_yesterday = Time.now - (60*60*24)
155
- expect(subject.is_more_than_month_old?(just_yesterday)).to be_falsey
155
+ s.is_more_than_month_old?(just_yesterday).should be_false
156
156
  end
157
157
  end
158
158
  end
@@ -2,14 +2,14 @@ require "automan"
2
2
 
3
3
  describe Automan::Ec2::Instance do
4
4
 
5
- it { is_expected.to respond_to :windows_password }
6
- it { is_expected.to respond_to :password_data }
7
- it { is_expected.to respond_to :decrypt_password }
8
- it { is_expected.to respond_to :windows_name }
9
- it { is_expected.to respond_to :show_env }
5
+ it { should respond_to :windows_password }
6
+ it { should respond_to :password_data }
7
+ it { should respond_to :decrypt_password }
8
+ it { should respond_to :windows_name }
9
+ it { should respond_to :show_env }
10
10
 
11
11
  describe '#windows_password' do
12
- subject() do
12
+ subject(:i) do
13
13
  AWS.stub!
14
14
  i = Automan::Ec2::Instance.new
15
15
  i.logger = Logger.new('/dev/null')
@@ -17,24 +17,24 @@ describe Automan::Ec2::Instance do
17
17
  end
18
18
 
19
19
  it "returns nil if password could not be found" do
20
- allow(subject).to receive(:password_data).and_return nil
21
- expect(subject.windows_password('foo','bar')).to be_nil
20
+ i.stub(:password_data).and_return nil
21
+ i.windows_password('foo','bar').should be_nil
22
22
  end
23
23
 
24
24
  it "returns nil if the aws request fails" do
25
- allow(subject).to receive(:password_data).and_raise Automan::Ec2::RequestFailedError
26
- expect(subject.windows_password('foo','bar')).to be_nil
25
+ i.stub(:password_data).and_raise Automan::Ec2::RequestFailedError
26
+ i.windows_password('foo','bar').should be_nil
27
27
  end
28
28
 
29
29
  it "returns nil if the decrypt fails" do
30
- allow(subject).to receive(:password_data).and_return 'foo'
31
- allow(subject).to receive(:decrypt_password).and_return nil
32
- expect(subject.windows_password('foo','bar')).to be_nil
30
+ i.stub(:password_data).and_return 'foo'
31
+ i.stub(:decrypt_password).and_return nil
32
+ i.windows_password('foo','bar').should be_nil
33
33
  end
34
34
  end
35
35
 
36
36
  describe '#windows_name' do
37
- subject() do
37
+ subject(:i) do
38
38
  AWS.stub!
39
39
  i = Automan::Ec2::Instance.new
40
40
  i.logger = Logger.new('/dev/null')
@@ -42,15 +42,15 @@ describe Automan::Ec2::Instance do
42
42
  end
43
43
 
44
44
  it "returns nil if ip_address is nil" do
45
- expect(subject.windows_name(nil)).to be_nil
45
+ i.windows_name(nil).should be_nil
46
46
  end
47
47
 
48
48
  it "returns nil if ip_address is empty" do
49
- expect(subject.windows_name("")).to be_nil
49
+ i.windows_name("").should be_nil
50
50
  end
51
51
 
52
52
  it "converts ip_address to ip-xxxxxxxx" do
53
- expect(subject.windows_name('54.56.78.90')).to eq 'ip-36384e5a'
53
+ i.windows_name('54.56.78.90').should eq 'ip-36384e5a'
54
54
  end
55
55
  end
56
56
 
@@ -1,39 +1,39 @@
1
1
  require 'automan/mixins/aws_caller'
2
2
 
3
3
  describe Automan::Mixins::AwsCaller do
4
- subject() { (Class.new { include Automan::Mixins::AwsCaller }).new }
4
+ let(:s) { (Class.new { include Automan::Mixins::AwsCaller }).new }
5
5
 
6
6
  services = [
7
7
  :s3, :cfn, :as, :eb, :r53, :elb, :rds, :ec2
8
8
  ]
9
9
 
10
10
  services.each do |svc|
11
- it { is_expected.to respond_to svc }
11
+ it { s.should respond_to svc }
12
12
  end
13
13
 
14
- it { is_expected.to respond_to :parse_s3_path }
14
+ it { s.should respond_to :parse_s3_path }
15
15
 
16
16
  describe '#parse_s3_path' do
17
17
  it "parses s3 path into bucket and key" do
18
- bucket, key = subject.parse_s3_path('s3://foo/bar/baz')
19
- expect(bucket).to eq('foo')
20
- expect(key).to eq ('bar/baz')
18
+ bucket, key = s.parse_s3_path('s3://foo/bar/baz')
19
+ bucket.should eq('foo')
20
+ key.should eq ('bar/baz')
21
21
  end
22
22
 
23
23
  it "raises error if it doesn't start with s3://" do
24
24
  expect {
25
- subject.parse_s3_path 'foo'
25
+ s.parse_s3_path 'foo'
26
26
  }.to raise_error ArgumentError
27
27
  end
28
28
  end
29
29
 
30
30
  describe '#looks_like_s3_path?' do
31
31
  it 'returns true if it begins with "s3://"' do
32
- expect(subject.looks_like_s3_path?('s3://foo')).to be_truthy
32
+ s.looks_like_s3_path?('s3://foo').should be_true
33
33
  end
34
34
 
35
35
  it 'returns false if it does not start with "s3://"' do
36
- expect(subject.looks_like_s3_path?('foobar')).to be_falsey
36
+ s.looks_like_s3_path?('foobar').should be_false
37
37
  end
38
38
  end
39
39
  end
@@ -1,43 +1,44 @@
1
1
  require 'automan/mixins/utils'
2
2
 
3
3
  describe Automan::Mixins::Utils do
4
- subject() { (Class.new { include Automan::Mixins::Utils }).new }
4
+ let(:s) { (Class.new { include Automan::Mixins::Utils }).new }
5
5
 
6
6
  it "adds String#underscore" do
7
- expect(String.new).to respond_to :underscore
7
+ s = String.new
8
+ s.should respond_to :underscore
8
9
  end
9
10
 
10
11
  describe "String#underscore" do
11
12
  it "underscore's like a boss" do
12
- expect("Namespace".underscore).to eq "namespace"
13
- expect("OptionName".underscore).to eq "option_name"
14
- expect("Value".underscore).to eq "value"
13
+ "Namespace".underscore.should eq "namespace"
14
+ "OptionName".underscore.should eq "option_name"
15
+ "Value".underscore.should eq "value"
15
16
  end
16
17
  end
17
18
 
18
- it { is_expected.to respond_to :region_from_az }
19
+ it { s.should respond_to :region_from_az }
19
20
 
20
21
  it "returns az properly" do
21
- expect(subject.region_from_az("us-east-1a")).to eq 'us-east-1'
22
- expect(subject.region_from_az("us-east-1b")).to eq 'us-east-1'
23
- expect(subject.region_from_az("us-east-1c")).to eq 'us-east-1'
24
- expect(subject.region_from_az("us-east-1d")).to eq 'us-east-1'
25
- expect(subject.region_from_az("ap-northeast-1a")).to eq 'ap-northeast-1'
26
- expect(subject.region_from_az("ap-northeast-1b")).to eq 'ap-northeast-1'
27
- expect(subject.region_from_az("ap-northeast-1c")).to eq 'ap-northeast-1'
28
- expect(subject.region_from_az("sa-east-1a")).to eq 'sa-east-1'
29
- expect(subject.region_from_az("sa-east-1b")).to eq 'sa-east-1'
30
- expect(subject.region_from_az("ap-southeast-1a")).to eq 'ap-southeast-1'
31
- expect(subject.region_from_az("ap-southeast-1b")).to eq 'ap-southeast-1'
32
- expect(subject.region_from_az("ap-southeast-2a")).to eq 'ap-southeast-2'
33
- expect(subject.region_from_az("ap-southeast-2b")).to eq 'ap-southeast-2'
34
- expect(subject.region_from_az("us-west-2a")).to eq 'us-west-2'
35
- expect(subject.region_from_az("us-west-2b")).to eq 'us-west-2'
36
- expect(subject.region_from_az("us-west-2c")).to eq 'us-west-2'
37
- expect(subject.region_from_az("us-west-1a")).to eq 'us-west-1'
38
- expect(subject.region_from_az("us-west-1c")).to eq 'us-west-1'
39
- expect(subject.region_from_az("eu-west-1a")).to eq 'eu-west-1'
40
- expect(subject.region_from_az("eu-west-1b")).to eq 'eu-west-1'
41
- expect(subject.region_from_az("eu-west-1c")).to eq 'eu-west-1'
22
+ s.region_from_az("us-east-1a").should eq 'us-east-1'
23
+ s.region_from_az("us-east-1b").should eq 'us-east-1'
24
+ s.region_from_az("us-east-1c").should eq 'us-east-1'
25
+ s.region_from_az("us-east-1d").should eq 'us-east-1'
26
+ s.region_from_az("ap-northeast-1a").should eq 'ap-northeast-1'
27
+ s.region_from_az("ap-northeast-1b").should eq 'ap-northeast-1'
28
+ s.region_from_az("ap-northeast-1c").should eq 'ap-northeast-1'
29
+ s.region_from_az("sa-east-1a").should eq 'sa-east-1'
30
+ s.region_from_az("sa-east-1b").should eq 'sa-east-1'
31
+ s.region_from_az("ap-southeast-1a").should eq 'ap-southeast-1'
32
+ s.region_from_az("ap-southeast-1b").should eq 'ap-southeast-1'
33
+ s.region_from_az("ap-southeast-2a").should eq 'ap-southeast-2'
34
+ s.region_from_az("ap-southeast-2b").should eq 'ap-southeast-2'
35
+ s.region_from_az("us-west-2a").should eq 'us-west-2'
36
+ s.region_from_az("us-west-2b").should eq 'us-west-2'
37
+ s.region_from_az("us-west-2c").should eq 'us-west-2'
38
+ s.region_from_az("us-west-1a").should eq 'us-west-1'
39
+ s.region_from_az("us-west-1c").should eq 'us-west-1'
40
+ s.region_from_az("eu-west-1a").should eq 'eu-west-1'
41
+ s.region_from_az("eu-west-1b").should eq 'eu-west-1'
42
+ s.region_from_az("eu-west-1c").should eq 'eu-west-1'
42
43
  end
43
44
  end