kumogata 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,40 +1,40 @@
1
1
  describe 'Kumogata::Client#delete' do
2
2
  it 'update a stack from Ruby template' do
3
3
  run_client(:delete, :arguments => ['MyStack'], :options => {:force => true}) do |client, cf|
4
- client.should_receive(:print_event_log).once
5
- client.should_receive(:create_event_log).once
4
+ expect(client).to receive(:print_event_log).once
5
+ expect(client).to receive(:create_event_log).once
6
6
 
7
7
  stack = make_double('stack') do |obj|
8
- obj.should_receive(:delete).with(no_args())
9
- obj.should_receive(:status).and_return(
8
+ expect(obj).to receive(:delete).with(no_args())
9
+ expect(obj).to receive(:status).and_return(
10
10
  'DELETE_COMPLETE', 'DELETE_COMPLETE', 'DELETE_COMPLETE')
11
11
  end
12
12
 
13
13
  stacks = make_double('stacks') do |obj|
14
- obj.should_receive(:[])
14
+ expect(obj).to receive(:[])
15
15
  .with('MyStack') { stack }
16
16
  end
17
17
 
18
- cf.should_receive(:stacks) { stacks }
18
+ expect(cf).to receive(:stacks) { stacks }
19
19
  end
20
20
  end
21
21
 
22
22
  it 'update a stack from Ruby template (detach)' do
23
23
  out = run_client(:delete, :arguments => ['MyStack'], :options => {:force => true, :detach => true}) do |client, cf|
24
- client.should_not_receive(:print_event_log)
25
- client.should_receive(:create_event_log).once
24
+ expect(client).not_to receive(:print_event_log)
25
+ expect(client).to receive(:create_event_log).once
26
26
 
27
27
  stack = make_double('stack') do |obj|
28
- obj.should_receive(:delete).with(no_args())
29
- obj.should_receive(:status).once
28
+ expect(obj).to receive(:delete).with(no_args())
29
+ expect(obj).to receive(:status).once
30
30
  end
31
31
 
32
32
  stacks = make_double('stacks') do |obj|
33
- obj.should_receive(:[])
33
+ expect(obj).to receive(:[])
34
34
  .with('MyStack') { stack }
35
35
  end
36
36
 
37
- cf.should_receive(:stacks) { stacks }
37
+ expect(cf).to receive(:stacks) { stacks }
38
38
  end
39
39
 
40
40
  expect(out).to be_nil
@@ -26,15 +26,15 @@ describe 'Kumogata::Client#export' do
26
26
 
27
27
  template = run_client(:export, :arguments => ['MyStack']) do |client, cf|
28
28
  stack = make_double('stack') do |obj|
29
- obj.should_receive(:status) { 'CREATE_COMPLETE' }
30
- obj.should_receive(:template) { json }
29
+ expect(obj).to receive(:status) { 'CREATE_COMPLETE' }
30
+ expect(obj).to receive(:template) { json }
31
31
  end
32
32
 
33
33
  stacks = make_double('stacks') do |obj|
34
- obj.should_receive(:[]).with('MyStack') { stack }
34
+ expect(obj).to receive(:[]).with('MyStack') { stack }
35
35
  end
36
36
 
37
- cf.should_receive(:stacks) { stacks }
37
+ expect(cf).to receive(:stacks) { stacks }
38
38
  end
39
39
 
40
40
  expect(template).to eq((<<-EOS).chomp)
@@ -84,15 +84,15 @@ end
84
84
 
85
85
  template = run_client(:export, :arguments => ['MyStack'], :options => {:format => :json}) do |client, cf|
86
86
  stack = make_double('stack') do |obj|
87
- obj.should_receive(:status) { 'CREATE_COMPLETE' }
88
- obj.should_receive(:template) { json }
87
+ expect(obj).to receive(:status) { 'CREATE_COMPLETE' }
88
+ expect(obj).to receive(:template) { json }
89
89
  end
90
90
 
91
91
  stacks = make_double('stacks') do |obj|
92
- obj.should_receive(:[]).with('MyStack') { stack }
92
+ expect(obj).to receive(:[]).with('MyStack') { stack }
93
93
  end
94
94
 
95
- cf.should_receive(:stacks) { stacks }
95
+ expect(cf).to receive(:stacks) { stacks }
96
96
  end
97
97
 
98
98
  expect(template).to eq((<<-EOS).chomp)
@@ -2,20 +2,20 @@ describe 'Kumogata::Client#list' do
2
2
  it 'list stacks' do
3
3
  json = run_client(:list) do |client, cf|
4
4
  stack1 = make_double('stack1') do |obj|
5
- obj.should_receive(:name) { 'stack1' }
6
- obj.should_receive(:creation_time) { '2014-03-02 16:17:18 UTC' }
7
- obj.should_receive(:status) { 'CREATE_COMPLETE' }
8
- obj.should_receive(:description) { nil }
5
+ expect(obj).to receive(:name) { 'stack1' }
6
+ expect(obj).to receive(:creation_time) { '2014-03-02 16:17:18 UTC' }
7
+ expect(obj).to receive(:status) { 'CREATE_COMPLETE' }
8
+ expect(obj).to receive(:description) { nil }
9
9
  end
10
10
 
11
11
  stack2 = make_double('stack2') do |obj|
12
- obj.should_receive(:name) { 'stack2' }
13
- obj.should_receive(:creation_time) { '2014-03-02 16:17:19 UTC' }
14
- obj.should_receive(:status) { 'CREATE_COMPLETE' }
15
- obj.should_receive(:description) { nil }
12
+ expect(obj).to receive(:name) { 'stack2' }
13
+ expect(obj).to receive(:creation_time) { '2014-03-02 16:17:19 UTC' }
14
+ expect(obj).to receive(:status) { 'CREATE_COMPLETE' }
15
+ expect(obj).to receive(:description) { nil }
16
16
  end
17
17
 
18
- cf.should_receive(:stacks) { [stack1, stack2] }
18
+ expect(cf).to receive(:stacks) { [stack1, stack2] }
19
19
  end
20
20
 
21
21
  expect(json).to eq((<<-EOS).chomp)
@@ -39,17 +39,17 @@ describe 'Kumogata::Client#list' do
39
39
  it 'list a specified stack' do
40
40
  json = run_client(:list, :arguments => ['stack1']) do |client, cf|
41
41
  stack1 = make_double('stack1') do |obj|
42
- obj.should_receive(:name).twice { 'stack1' }
43
- obj.should_receive(:creation_time) { '2014-03-02 16:17:18 UTC' }
44
- obj.should_receive(:status) { 'CREATE_COMPLETE' }
45
- obj.should_receive(:description) { nil }
42
+ expect(obj).to receive(:name).twice { 'stack1' }
43
+ expect(obj).to receive(:creation_time) { '2014-03-02 16:17:18 UTC' }
44
+ expect(obj).to receive(:status) { 'CREATE_COMPLETE' }
45
+ expect(obj).to receive(:description) { nil }
46
46
  end
47
47
 
48
48
  stack2 = make_double('stack2') do |obj|
49
- obj.should_receive(:name) { 'stack2' }
49
+ expect(obj).to receive(:name) { 'stack2' }
50
50
  end
51
51
 
52
- cf.should_receive(:stacks) { [stack1, stack2] }
52
+ expect(cf).to receive(:stacks) { [stack1, stack2] }
53
53
  end
54
54
 
55
55
  expect(json).to eq((<<-EOS).chomp)
@@ -3,28 +3,28 @@ describe 'Kumogata::Client#show_events' do
3
3
 
4
4
  resources = run_client(:show_events, :arguments => ['MyStack']) do |client, cf|
5
5
  event = make_double('event') do |obj|
6
- obj.should_receive(:event_id) { "f45e6070-a4f7-11e3-9326-5088487c4896" }
7
- obj.should_receive(:logical_resource_id) { "kumogata-f11118a4-a4f7-11e3-8183-98fe943e66ca" }
8
- obj.should_receive(:physical_resource_id) { "arn:aws:cloudformation:ap-northeast-1:822997939312:stack/kumogata-f11118a4-a4f7-11e3-8183-98fe943e66ca/f1381a30-a4f7-11e3-a340-506cf9a1c096" }
9
- obj.should_receive(:resource_properties) { nil }
10
- obj.should_receive(:resource_status) { "CREATE_FAILED" }
11
- obj.should_receive(:resource_status_reason) { "The following resource(s) failed to create: [myEC2Instance]. " }
12
- obj.should_receive(:resource_type) { "AWS::CloudFormation::Stack" }
13
- obj.should_receive(:stack_id) { "arn:aws:cloudformation:ap-northeast-1:822997939312:stack/kumogata-f11118a4-a4f7-11e3-8183-98fe943e66ca/f1381a30-a4f7-11e3-a340-506cf9a1c096" }
14
- obj.should_receive(:stack_name) { "kumogata-f11118a4-a4f7-11e3-8183-98fe943e66ca" }
15
- obj.should_receive(:timestamp) { "2014-03-06 06:24:21 UTC" }
6
+ expect(obj).to receive(:event_id) { "f45e6070-a4f7-11e3-9326-5088487c4896" }
7
+ expect(obj).to receive(:logical_resource_id) { "kumogata-f11118a4-a4f7-11e3-8183-98fe943e66ca" }
8
+ expect(obj).to receive(:physical_resource_id) { "arn:aws:cloudformation:ap-northeast-1:822997939312:stack/kumogata-f11118a4-a4f7-11e3-8183-98fe943e66ca/f1381a30-a4f7-11e3-a340-506cf9a1c096" }
9
+ expect(obj).to receive(:resource_properties) { nil }
10
+ expect(obj).to receive(:resource_status) { "CREATE_FAILED" }
11
+ expect(obj).to receive(:resource_status_reason) { "The following resource(s) failed to create: [myEC2Instance]. " }
12
+ expect(obj).to receive(:resource_type) { "AWS::CloudFormation::Stack" }
13
+ expect(obj).to receive(:stack_id) { "arn:aws:cloudformation:ap-northeast-1:822997939312:stack/kumogata-f11118a4-a4f7-11e3-8183-98fe943e66ca/f1381a30-a4f7-11e3-a340-506cf9a1c096" }
14
+ expect(obj).to receive(:stack_name) { "kumogata-f11118a4-a4f7-11e3-8183-98fe943e66ca" }
15
+ expect(obj).to receive(:timestamp) { "2014-03-06 06:24:21 UTC" }
16
16
  end
17
17
 
18
18
  stack = make_double('stack') do |obj|
19
- obj.should_receive(:status) { 'CREATE_COMPLETE' }
20
- obj.should_receive(:events).and_return([event])
19
+ expect(obj).to receive(:status) { 'CREATE_COMPLETE' }
20
+ expect(obj).to receive(:events).and_return([event])
21
21
  end
22
22
 
23
23
  stacks = make_double('stacks') do |obj|
24
- obj.should_receive(:[]).with('MyStack') { stack }
24
+ expect(obj).to receive(:[]).with('MyStack') { stack }
25
25
  end
26
26
 
27
- cf.should_receive(:stacks) { stacks }
27
+ expect(cf).to receive(:stacks) { stacks }
28
28
  end
29
29
 
30
30
  expect(resources).to eq((<<-EOS).chomp)
@@ -3,20 +3,20 @@ describe 'Kumogata::Client#show_outputs' do
3
3
 
4
4
  outputs = run_client(:show_outputs, :arguments => ['MyStack']) do |client, cf|
5
5
  output = make_double('output') do |obj|
6
- obj.should_receive(:key) { 'AZ' }
7
- obj.should_receive(:value) { 'ap-northeast-1a' }
6
+ expect(obj).to receive(:key) { 'AZ' }
7
+ expect(obj).to receive(:value) { 'ap-northeast-1a' }
8
8
  end
9
9
 
10
10
  stack = make_double('stack') do |obj|
11
- obj.should_receive(:status) { 'CREATE_COMPLETE' }
12
- obj.should_receive(:outputs) { [output] }
11
+ expect(obj).to receive(:status) { 'CREATE_COMPLETE' }
12
+ expect(obj).to receive(:outputs) { [output] }
13
13
  end
14
14
 
15
15
  stacks = make_double('stacks') do |obj|
16
- obj.should_receive(:[]).with('MyStack') { stack }
16
+ expect(obj).to receive(:[]).with('MyStack') { stack }
17
17
  end
18
18
 
19
- cf.should_receive(:stacks) { stacks }
19
+ expect(cf).to receive(:stacks) { stacks }
20
20
  end
21
21
 
22
22
  expect(outputs).to eq((<<-EOS).chomp)
@@ -3,8 +3,8 @@ describe 'Kumogata::Client#show_resources' do
3
3
 
4
4
  resources = run_client(:show_resources, :arguments => ['MyStack']) do |client, cf|
5
5
  stack = make_double('stack') do |obj|
6
- obj.should_receive(:status) { 'CREATE_COMPLETE' }
7
- obj.should_receive(:resource_summaries).and_return([
6
+ expect(obj).to receive(:status) { 'CREATE_COMPLETE' }
7
+ expect(obj).to receive(:resource_summaries).and_return([
8
8
  {
9
9
  :logical_resource_id => 'myEC2Instance',
10
10
  :physical_resource_id => 'i-XXXXXXXX',
@@ -17,10 +17,10 @@ describe 'Kumogata::Client#show_resources' do
17
17
  end
18
18
 
19
19
  stacks = make_double('stacks') do |obj|
20
- obj.should_receive(:[]).with('MyStack') { stack }
20
+ expect(obj).to receive(:[]).with('MyStack') { stack }
21
21
  end
22
22
 
23
- cf.should_receive(:stacks) { stacks }
23
+ expect(cf).to receive(:stacks) { stacks }
24
24
  end
25
25
 
26
26
  expect(resources).to eq((<<-EOS).chomp)
@@ -22,37 +22,94 @@ end
22
22
 
23
23
  run_client(:update, :arguments => ['MyStack'], :template => template) do |client, cf|
24
24
  json = eval_template(template).to_json
25
- client.should_receive(:print_event_log).once
26
- client.should_receive(:create_event_log).once
25
+ expect(client).to receive(:print_event_log).once
26
+ expect(client).to receive(:create_event_log).once
27
27
 
28
28
  output = make_double('output') do |obj|
29
- obj.should_receive(:key) { 'AZ' }
30
- obj.should_receive(:value) { 'ap-northeast-1b' }
29
+ expect(obj).to receive(:key) { 'AZ' }
30
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
31
31
  end
32
32
 
33
33
  resource_summary = make_double('resource_summary') do |obj|
34
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
35
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
36
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
37
- obj.should_receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
38
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
39
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
34
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
35
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
36
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
37
+ expect(obj).to receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
38
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
39
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
40
40
  end
41
41
 
42
42
  stack = make_double('stack') do |obj|
43
- obj.should_receive(:update).with(:template => json)
44
- obj.should_receive(:status).and_return(
43
+ expect(obj).to receive(:update).with(:template => json)
44
+ expect(obj).to receive(:status).and_return(
45
45
  'UPDATE_COMPLETE', 'UPDATE_COMPLETE', 'UPDATE_COMPLETE')
46
- obj.should_receive(:outputs) { [output] }
47
- obj.should_receive(:resource_summaries) { [resource_summary] }
46
+ expect(obj).to receive(:outputs) { [output] }
47
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
48
48
  end
49
49
 
50
50
  stacks = make_double('stacks') do |obj|
51
- obj.should_receive(:[])
51
+ expect(obj).to receive(:[])
52
52
  .with('MyStack') { stack }
53
53
  end
54
54
 
55
- cf.should_receive(:stacks) { stacks }
55
+ expect(cf).to receive(:stacks) { stacks }
56
+ end
57
+ end
58
+
59
+ it 'update a stack from Ruby template (with capabilities option)' do
60
+ template = <<-EOS
61
+ Resources do
62
+ myEC2Instance do
63
+ Type "AWS::EC2::Instance"
64
+ Properties do
65
+ ImageId "ami-XXXXXXXX"
66
+ InstanceType "t1.micro"
67
+ end
68
+ end
69
+ end
70
+
71
+ Outputs do
72
+ AZ do
73
+ Value do
74
+ Fn__GetAtt "myEC2Instance", "AvailabilityZone"
75
+ end
76
+ end
77
+ end
78
+ EOS
79
+
80
+ run_client(:update, :arguments => ['MyStack'], :template => template, :options => {:capabilities => ['AWS::CloudFormation::Stack']}) do |client, cf|
81
+ json = eval_template(template).to_json
82
+ expect(client).to receive(:print_event_log).once
83
+ expect(client).to receive(:create_event_log).once
84
+
85
+ output = make_double('output') do |obj|
86
+ expect(obj).to receive(:key) { 'AZ' }
87
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
88
+ end
89
+
90
+ resource_summary = make_double('resource_summary') do |obj|
91
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
92
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
93
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
94
+ expect(obj).to receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
95
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
96
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
97
+ end
98
+
99
+ stack = make_double('stack') do |obj|
100
+ expect(obj).to receive(:update).with(:template => json, :capabilities => ['AWS::CloudFormation::Stack'])
101
+ expect(obj).to receive(:status).and_return(
102
+ 'UPDATE_COMPLETE', 'UPDATE_COMPLETE', 'UPDATE_COMPLETE')
103
+ expect(obj).to receive(:outputs) { [output] }
104
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
105
+ end
106
+
107
+ stacks = make_double('stacks') do |obj|
108
+ expect(obj).to receive(:[])
109
+ .with('MyStack') { stack }
110
+ end
111
+
112
+ expect(cf).to receive(:stacks) { stacks }
56
113
  end
57
114
  end
58
115
 
@@ -79,22 +136,22 @@ end
79
136
 
80
137
  out = run_client(:update, :arguments => ['MyStack'], :template => template, :options => {:detach => true}) do |client, cf|
81
138
  json = eval_template(template).to_json
82
- client.should_not_receive(:print_event_log)
83
- client.should_receive(:create_event_log).once
139
+ expect(client).not_to receive(:print_event_log)
140
+ expect(client).to receive(:create_event_log).once
84
141
 
85
142
  stack = make_double('stack') do |obj|
86
- obj.should_receive(:update).with(:template => json)
87
- obj.should_receive(:status).once
88
- obj.should_not_receive(:outputs)
89
- obj.should_not_receive(:resource_summaries)
143
+ expect(obj).to receive(:update).with(:template => json)
144
+ expect(obj).to receive(:status).once
145
+ expect(obj).not_to receive(:outputs)
146
+ expect(obj).not_to receive(:resource_summaries)
90
147
  end
91
148
 
92
149
  stacks = make_double('stacks') do |obj|
93
- obj.should_receive(:[])
150
+ expect(obj).to receive(:[])
94
151
  .with('MyStack') { stack }
95
152
  end
96
153
 
97
- cf.should_receive(:stacks) { stacks }
154
+ expect(cf).to receive(:stacks) { stacks }
98
155
  end
99
156
 
100
157
  expect(out).to be_nil
@@ -128,37 +185,37 @@ end
128
185
  "DeletionPolicyUpdateKeyForKumogata" => "DeletionPolicyUpdateValueForKumogata1388534400"
129
186
  }
130
187
  json = template.to_json
131
- client.should_receive(:print_event_log).once
132
- client.should_receive(:create_event_log).once
188
+ expect(client).to receive(:print_event_log).once
189
+ expect(client).to receive(:create_event_log).once
133
190
 
134
191
  output = make_double('output') do |obj|
135
- obj.should_receive(:key) { 'AZ' }
136
- obj.should_receive(:value) { 'ap-northeast-1b' }
192
+ expect(obj).to receive(:key) { 'AZ' }
193
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
137
194
  end
138
195
 
139
196
  resource_summary = make_double('resource_summary') do |obj|
140
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
141
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
142
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
143
- obj.should_receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
144
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
145
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
197
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
198
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
199
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
200
+ expect(obj).to receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
201
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
202
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
146
203
  end
147
204
 
148
205
  stack = make_double('stack') do |obj|
149
- obj.should_receive(:update).with(:template => json)
150
- obj.should_receive(:status).and_return(
206
+ expect(obj).to receive(:update).with(:template => json)
207
+ expect(obj).to receive(:status).and_return(
151
208
  'UPDATE_COMPLETE', 'UPDATE_COMPLETE', 'UPDATE_COMPLETE')
152
- obj.should_receive(:outputs) { [output] }
153
- obj.should_receive(:resource_summaries) { [resource_summary] }
209
+ expect(obj).to receive(:outputs) { [output] }
210
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
154
211
  end
155
212
 
156
213
  stacks = make_double('stacks') do |obj|
157
- obj.should_receive(:[])
214
+ expect(obj).to receive(:[])
158
215
  .with('MyStack') { stack }
159
216
  end
160
217
 
161
- cf.should_receive(:stacks) { stacks }
218
+ expect(cf).to receive(:stacks) { stacks }
162
219
  end
163
220
  end
164
221
  end
@@ -207,53 +264,53 @@ end
207
264
 
208
265
  run_client(:update, :arguments => ['MyStack'], :template => template) do |client, cf|
209
266
  json = eval_template(template).to_json
210
- client.should_receive(:print_event_log).once
211
- client.should_receive(:create_event_log).once
267
+ expect(client).to receive(:print_event_log).once
268
+ expect(client).to receive(:create_event_log).once
212
269
 
213
270
  output1 = make_double('output') do |obj|
214
- obj.should_receive(:key) { 'AZ' }
215
- obj.should_receive(:value) { 'ap-northeast-1b' }
271
+ expect(obj).to receive(:key) { 'AZ' }
272
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
216
273
  end
217
274
 
218
275
  output2 = make_double('output') do |obj|
219
- obj.should_receive(:key) { 'Region' }
220
- obj.should_receive(:value) { 'ap-northeast-1' }
276
+ expect(obj).to receive(:key) { 'Region' }
277
+ expect(obj).to receive(:value) { 'ap-northeast-1' }
221
278
  end
222
279
 
223
280
  resource_summary = make_double('resource_summary') do |obj|
224
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
225
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
226
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
227
- obj.should_receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
228
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
229
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
281
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
282
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
283
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
284
+ expect(obj).to receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
285
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
286
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
230
287
  end
231
288
 
232
289
  stack = make_double('stack') do |obj|
233
- obj.should_receive(:update).with(:template => json)
234
- obj.should_receive(:status).and_return(
290
+ expect(obj).to receive(:update).with(:template => json)
291
+ expect(obj).to receive(:status).and_return(
235
292
  'UPDATE_COMPLETE', 'UPDATE_COMPLETE', 'UPDATE_COMPLETE')
236
- obj.should_receive(:outputs) { [output1, output2] }
237
- obj.should_receive(:resource_summaries) { [resource_summary] }
293
+ expect(obj).to receive(:outputs) { [output1, output2] }
294
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
238
295
  end
239
296
 
240
297
  stacks = make_double('stacks') do |obj|
241
- obj.should_receive(:[])
298
+ expect(obj).to receive(:[])
242
299
  .with('MyStack') { stack }
243
300
  end
244
301
 
245
- cf.should_receive(:stacks) { stacks }
302
+ expect(cf).to receive(:stacks) { stacks }
246
303
 
247
304
  process_status1 = double('process_status1')
248
305
  process_status2 = double('process_status2')
249
306
 
250
- Open3.should_not_receive(:capture3)
307
+ expect(Open3).not_to receive(:capture3)
251
308
 
252
- client.instance_variable_get(:@post_processing)
253
- .should_not_receive(:print_command_result)
309
+ expect(client.instance_variable_get(:@post_processing))
310
+ .not_to receive(:print_command_result)
254
311
 
255
- client.instance_variable_get(:@post_processing)
256
- .should_not_receive(:save_command_results)
312
+ expect(client.instance_variable_get(:@post_processing))
313
+ .not_to receive(:save_command_results)
257
314
  end
258
315
  end
259
316
 
@@ -293,52 +350,52 @@ end
293
350
 
294
351
  run_client(:update, :arguments => ['MyStack'], :template => template) do |client, cf|
295
352
  json = eval_template(template).to_json
296
- client.should_receive(:print_event_log).once
297
- client.should_receive(:create_event_log).once
353
+ expect(client).to receive(:print_event_log).once
354
+ expect(client).to receive(:create_event_log).once
298
355
 
299
356
  output = make_double('output') do |obj|
300
- obj.should_receive(:key) { 'PublicIp' }
301
- obj.should_receive(:value) { '127.0.0.1' }
357
+ expect(obj).to receive(:key) { 'PublicIp' }
358
+ expect(obj).to receive(:value) { '127.0.0.1' }
302
359
  end
303
360
 
304
361
  resource_summary = make_double('resource_summary') do |obj|
305
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
306
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
307
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
308
- obj.should_receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
309
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
310
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
362
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
363
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
364
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
365
+ expect(obj).to receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
366
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
367
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
311
368
  end
312
369
 
313
370
  stack = make_double('stack') do |obj|
314
- obj.should_receive(:update).with(:template => json)
315
- obj.should_receive(:status).and_return(
371
+ expect(obj).to receive(:update).with(:template => json)
372
+ expect(obj).to receive(:status).and_return(
316
373
  'UPDATE_COMPLETE', 'UPDATE_COMPLETE', 'UPDATE_COMPLETE')
317
- obj.should_receive(:outputs) { [output] }
318
- obj.should_receive(:resource_summaries) { [resource_summary] }
374
+ expect(obj).to receive(:outputs) { [output] }
375
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
319
376
  end
320
377
 
321
378
  stacks = make_double('stacks') do |obj|
322
- obj.should_receive(:[])
379
+ expect(obj).to receive(:[])
323
380
  .with('MyStack') { stack }
324
381
  end
325
382
 
326
- cf.should_receive(:stacks) { stacks }
383
+ expect(cf).to receive(:stacks) { stacks }
327
384
 
328
- client.instance_variable_get(:@post_processing)
329
- .should_receive(:run_ssh_command)
385
+ expect(client.instance_variable_get(:@post_processing))
386
+ .to receive(:run_ssh_command)
330
387
  .with({"host"=>"<%= Key \"PublicIp\" %>", "user"=>"ec2-user", "request_pty"=>true}, " ls\n", {"PublicIp"=>"127.0.0.1"})
331
388
  .and_return(["file1\nfile2\n", "", 0])
332
389
 
333
- client.instance_variable_get(:@post_processing)
334
- .should_receive(:print_command).with('ssh_command')
390
+ expect(client.instance_variable_get(:@post_processing))
391
+ .to receive(:print_command).with('ssh_command')
335
392
 
336
- client.instance_variable_get(:@post_processing)
337
- .should_receive(:print_command_result)
393
+ expect(client.instance_variable_get(:@post_processing))
394
+ .to receive(:print_command_result)
338
395
  .with("file1\nfile2\n", "", 0)
339
396
 
340
- client.instance_variable_get(:@post_processing)
341
- .should_receive(:save_command_results)
397
+ expect(client.instance_variable_get(:@post_processing))
398
+ .to receive(:save_command_results)
342
399
  .with([{'ssh_command' => {'ExitStatus' => 0, 'StdOut' => "file1\nfile2\n", 'StdErr' => ""}}])
343
400
  end
344
401
  end
@@ -383,52 +440,52 @@ end
383
440
 
384
441
  run_client(:update, :arguments => ['MyStack'], :template => template) do |client, cf|
385
442
  json = eval_template(template).to_json
386
- client.should_receive(:print_event_log).once
387
- client.should_receive(:create_event_log).once
443
+ expect(client).to receive(:print_event_log).once
444
+ expect(client).to receive(:create_event_log).once
388
445
 
389
446
  output = make_double('output') do |obj|
390
- obj.should_receive(:key) { 'PublicIp' }
391
- obj.should_receive(:value) { '127.0.0.1' }
447
+ expect(obj).to receive(:key) { 'PublicIp' }
448
+ expect(obj).to receive(:value) { '127.0.0.1' }
392
449
  end
393
450
 
394
451
  resource_summary = make_double('resource_summary') do |obj|
395
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
396
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
397
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
398
- obj.should_receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
399
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
400
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
452
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
453
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
454
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
455
+ expect(obj).to receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
456
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
457
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
401
458
  end
402
459
 
403
460
  stack = make_double('stack') do |obj|
404
- obj.should_receive(:update).with(:template => json)
405
- obj.should_receive(:status).and_return(
461
+ expect(obj).to receive(:update).with(:template => json)
462
+ expect(obj).to receive(:status).and_return(
406
463
  'UPDATE_COMPLETE', 'UPDATE_COMPLETE', 'UPDATE_COMPLETE')
407
- obj.should_receive(:outputs) { [output] }
408
- obj.should_receive(:resource_summaries) { [resource_summary] }
464
+ expect(obj).to receive(:outputs) { [output] }
465
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
409
466
  end
410
467
 
411
468
  stacks = make_double('stacks') do |obj|
412
- obj.should_receive(:[])
469
+ expect(obj).to receive(:[])
413
470
  .with('MyStack') { stack }
414
471
  end
415
472
 
416
- cf.should_receive(:stacks) { stacks }
473
+ expect(cf).to receive(:stacks) { stacks }
417
474
 
418
- client.instance_variable_get(:@post_processing)
419
- .should_receive(:run_ssh_command)
475
+ expect(client.instance_variable_get(:@post_processing))
476
+ .to receive(:run_ssh_command)
420
477
  .with({"host"=>"<%= Key \"PublicIp\" %>", "user"=>"ec2-user", "request_pty"=>true}, " ls\n", {"PublicIp"=>"127-0-0-1"})
421
478
  .and_return(["file1\nfile2\n", "", 0])
422
479
 
423
- client.instance_variable_get(:@post_processing)
424
- .should_receive(:print_command).with('ssh_command')
480
+ expect(client.instance_variable_get(:@post_processing))
481
+ .to receive(:print_command).with('ssh_command')
425
482
 
426
- client.instance_variable_get(:@post_processing)
427
- .should_receive(:print_command_result)
483
+ expect(client.instance_variable_get(:@post_processing))
484
+ .to receive(:print_command_result)
428
485
  .with("file1\nfile2\n", "", 0)
429
486
 
430
- client.instance_variable_get(:@post_processing)
431
- .should_receive(:save_command_results)
487
+ expect(client.instance_variable_get(:@post_processing))
488
+ .to receive(:save_command_results)
432
489
  .with([{'ssh_command' => {'ExitStatus' => 0, 'StdOut' => "file1\nfile2\n", 'StdErr' => ""}}])
433
490
  end
434
491
  end
@@ -479,70 +536,70 @@ end
479
536
 
480
537
  run_client(:update, :arguments => ['MyStack'], :template => template) do |client, cf|
481
538
  json = eval_template(template).to_json
482
- client.should_receive(:print_event_log).once
483
- client.should_receive(:create_event_log).once
539
+ expect(client).to receive(:print_event_log).once
540
+ expect(client).to receive(:create_event_log).once
484
541
 
485
542
  output1 = make_double('output') do |obj|
486
- obj.should_receive(:key) { 'AZ' }
487
- obj.should_receive(:value) { 'ap-northeast-1b' }
543
+ expect(obj).to receive(:key) { 'AZ' }
544
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
488
545
  end
489
546
 
490
547
  output2 = make_double('output') do |obj|
491
- obj.should_receive(:key) { 'Region' }
492
- obj.should_receive(:value) { 'ap-northeast-1' }
548
+ expect(obj).to receive(:key) { 'Region' }
549
+ expect(obj).to receive(:value) { 'ap-northeast-1' }
493
550
  end
494
551
 
495
552
  resource_summary = make_double('resource_summary') do |obj|
496
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
497
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
498
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
499
- obj.should_receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
500
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
501
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
553
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
554
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
555
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
556
+ expect(obj).to receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
557
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
558
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
502
559
  end
503
560
 
504
561
  stack = make_double('stack') do |obj|
505
- obj.should_receive(:update).with(:template => json)
506
- obj.should_receive(:status).and_return(
562
+ expect(obj).to receive(:update).with(:template => json)
563
+ expect(obj).to receive(:status).and_return(
507
564
  'UPDATE_COMPLETE', 'UPDATE_COMPLETE', 'UPDATE_COMPLETE')
508
- obj.should_receive(:outputs) { [output1, output2] }
509
- obj.should_receive(:resource_summaries) { [resource_summary] }
565
+ expect(obj).to receive(:outputs) { [output1, output2] }
566
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
510
567
  end
511
568
 
512
569
  stacks = make_double('stacks') do |obj|
513
- obj.should_receive(:[])
570
+ expect(obj).to receive(:[])
514
571
  .with('MyStack') { stack }
515
572
  end
516
573
 
517
- cf.should_receive(:stacks) { stacks }
574
+ expect(cf).to receive(:stacks) { stacks }
518
575
 
519
576
 
520
- process_status1 = make_double('process_status1') {|obj| obj.should_receive(:to_i).and_return(0) }
521
- process_status2 = make_double('process_status2') {|obj| obj.should_receive(:to_i).and_return(0) }
577
+ process_status1 = make_double('process_status1') {|obj| expect(obj).to receive(:to_i).and_return(0) }
578
+ process_status2 = make_double('process_status2') {|obj| expect(obj).to receive(:to_i).and_return(0) }
522
579
 
523
- client.instance_variable_get(:@post_processing)
524
- .should_receive(:run_shell_command)
580
+ expect(client.instance_variable_get(:@post_processing))
581
+ .to receive(:run_shell_command)
525
582
  .with(" echo <%= Key \"AZ\" %>\n echo <%= Key \"Region\" %>\n", {"AZ"=>"ap-northeast-1b", "Region"=>"ap-northeast-1"})
526
583
  .and_return(["ap-northeast-1b\nap-northeast-1\n", "", process_status1])
527
- client.instance_variable_get(:@post_processing)
528
- .should_receive(:run_shell_command)
584
+ expect(client.instance_variable_get(:@post_processing))
585
+ .to receive(:run_shell_command)
529
586
  .with(" echo <%= Key \"Region\" %>\n echo <%= Key \"AZ\" %>\n", {"AZ"=>"ap-northeast-1b", "Region"=>"ap-northeast-1"})
530
587
  .and_return(["ap-northeast-1\nap-northeast-1b\n", "", process_status2])
531
588
 
532
- client.instance_variable_get(:@post_processing)
533
- .should_receive(:print_command).with('command_a')
534
- client.instance_variable_get(:@post_processing)
535
- .should_receive(:print_command).with('command_b')
589
+ expect(client.instance_variable_get(:@post_processing))
590
+ .to receive(:print_command).with('command_a')
591
+ expect(client.instance_variable_get(:@post_processing))
592
+ .to receive(:print_command).with('command_b')
536
593
 
537
- client.instance_variable_get(:@post_processing)
538
- .should_receive(:print_command_result)
594
+ expect(client.instance_variable_get(:@post_processing))
595
+ .to receive(:print_command_result)
539
596
  .with("ap-northeast-1b\nap-northeast-1\n", "", process_status1)
540
- client.instance_variable_get(:@post_processing)
541
- .should_receive(:print_command_result)
597
+ expect(client.instance_variable_get(:@post_processing))
598
+ .to receive(:print_command_result)
542
599
  .with("ap-northeast-1\nap-northeast-1b\n", "", process_status2)
543
600
 
544
- client.instance_variable_get(:@post_processing)
545
- .should_receive(:save_command_results)
601
+ expect(client.instance_variable_get(:@post_processing))
602
+ .to receive(:save_command_results)
546
603
  .with([{'command_a' => {'ExitStatus' => 0, 'StdOut' => "ap-northeast-1b\nap-northeast-1\n", 'StdErr' => ""}},
547
604
  {'command_b' => {'ExitStatus' => 0, 'StdOut' => "ap-northeast-1\nap-northeast-1b\n", 'StdErr' => ""}}])
548
605
  end
@@ -594,53 +651,53 @@ end
594
651
 
595
652
  run_client(:update, :arguments => ['MyStack'], :template => template) do |client, cf|
596
653
  json = eval_template(template).to_json
597
- client.should_receive(:print_event_log).once
598
- client.should_receive(:create_event_log).once
654
+ expect(client).to receive(:print_event_log).once
655
+ expect(client).to receive(:create_event_log).once
599
656
 
600
657
  output1 = make_double('output') do |obj|
601
- obj.should_receive(:key) { 'AZ' }
602
- obj.should_receive(:value) { 'ap-northeast-1b' }
658
+ expect(obj).to receive(:key) { 'AZ' }
659
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
603
660
  end
604
661
 
605
662
  output2 = make_double('output') do |obj|
606
- obj.should_receive(:key) { 'Region' }
607
- obj.should_receive(:value) { 'ap-northeast-1' }
663
+ expect(obj).to receive(:key) { 'Region' }
664
+ expect(obj).to receive(:value) { 'ap-northeast-1' }
608
665
  end
609
666
 
610
667
  resource_summary = make_double('resource_summary') do |obj|
611
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
612
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
613
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
614
- obj.should_receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
615
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
616
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
668
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
669
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
670
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
671
+ expect(obj).to receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
672
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
673
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
617
674
  end
618
675
 
619
676
  stack = make_double('stack') do |obj|
620
- obj.should_receive(:update).with(:template => json)
621
- obj.should_receive(:status).and_return(
677
+ expect(obj).to receive(:update).with(:template => json)
678
+ expect(obj).to receive(:status).and_return(
622
679
  'UPDATE_COMPLETE', 'UPDATE_COMPLETE', 'UPDATE_COMPLETE')
623
- obj.should_receive(:outputs) { [output1, output2] }
624
- obj.should_receive(:resource_summaries) { [resource_summary] }
680
+ expect(obj).to receive(:outputs) { [output1, output2] }
681
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
625
682
  end
626
683
 
627
684
  stacks = make_double('stacks') do |obj|
628
- obj.should_receive(:[])
685
+ expect(obj).to receive(:[])
629
686
  .with('MyStack') { stack }
630
687
  end
631
688
 
632
- cf.should_receive(:stacks) { stacks }
689
+ expect(cf).to receive(:stacks) { stacks }
633
690
 
634
691
  process_status1 = double('process_status1')
635
692
  process_status2 = double('process_status2')
636
693
 
637
- Open3.should_not_receive(:capture3)
694
+ expect(Open3).not_to receive(:capture3)
638
695
 
639
- client.instance_variable_get(:@post_processing)
640
- .should_not_receive(:print_command_result)
696
+ expect(client.instance_variable_get(:@post_processing))
697
+ .not_to receive(:print_command_result)
641
698
 
642
- client.instance_variable_get(:@post_processing)
643
- .should_not_receive(:save_command_results)
699
+ expect(client.instance_variable_get(:@post_processing))
700
+ .not_to receive(:save_command_results)
644
701
  end
645
702
  end
646
703
 
@@ -675,37 +732,37 @@ end
675
732
 
676
733
  run_client(:update, :arguments => ['MyStack'], :template => template, :options => {:parameters => {'InstanceType'=>'m1.large'}}) do |client, cf|
677
734
  json = eval_template(template).to_json
678
- client.should_receive(:print_event_log).once
679
- client.should_receive(:create_event_log).once
735
+ expect(client).to receive(:print_event_log).once
736
+ expect(client).to receive(:create_event_log).once
680
737
 
681
738
  output = make_double('output') do |obj|
682
- obj.should_receive(:key) { 'AZ' }
683
- obj.should_receive(:value) { 'ap-northeast-1b' }
739
+ expect(obj).to receive(:key) { 'AZ' }
740
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
684
741
  end
685
742
 
686
743
  resource_summary = make_double('resource_summary') do |obj|
687
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
688
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
689
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
690
- obj.should_receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
691
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
692
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
744
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
745
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
746
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
747
+ expect(obj).to receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
748
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
749
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
693
750
  end
694
751
 
695
752
  stack = make_double('stack') do |obj|
696
- obj.should_receive(:update).with(:template => json, :parameters=>{"InstanceType"=>"m1.large"})
697
- obj.should_receive(:status).and_return(
753
+ expect(obj).to receive(:update).with(:template => json, :parameters=>{"InstanceType"=>"m1.large"})
754
+ expect(obj).to receive(:status).and_return(
698
755
  'UPDATE_COMPLETE', 'UPDATE_COMPLETE', 'UPDATE_COMPLETE')
699
- obj.should_receive(:outputs) { [output] }
700
- obj.should_receive(:resource_summaries) { [resource_summary] }
756
+ expect(obj).to receive(:outputs) { [output] }
757
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
701
758
  end
702
759
 
703
760
  stacks = make_double('stacks') do |obj|
704
- obj.should_receive(:[])
761
+ expect(obj).to receive(:[])
705
762
  .with('MyStack') { stack }
706
763
  end
707
764
 
708
- cf.should_receive(:stacks) { stacks }
765
+ expect(cf).to receive(:stacks) { stacks }
709
766
  end
710
767
  end
711
768
 
@@ -765,37 +822,37 @@ end
765
822
 
766
823
  run_client(:update, :arguments => ['MyStack'], :template => template, :options => {:parameters => {'InstanceType'=>'m1.large'}, :encrypt_parameters => ['Password']}) do |client, cf|
767
824
  json = eval_template(template, :add_encryption_password => true).to_json
768
- client.should_receive(:print_event_log).once
769
- client.should_receive(:create_event_log).once
825
+ expect(client).to receive(:print_event_log).once
826
+ expect(client).to receive(:create_event_log).once
770
827
 
771
828
  output = make_double('output') do |obj|
772
- obj.should_receive(:key) { 'AZ' }
773
- obj.should_receive(:value) { 'ap-northeast-1b' }
829
+ expect(obj).to receive(:key) { 'AZ' }
830
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
774
831
  end
775
832
 
776
833
  resource_summary = make_double('resource_summary') do |obj|
777
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
778
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
779
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
780
- obj.should_receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
781
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
782
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
834
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
835
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
836
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
837
+ expect(obj).to receive(:[]).with(:resource_status) { 'UPDATE_COMPLETE' }
838
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
839
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
783
840
  end
784
841
 
785
842
  stack = make_double('stack') do |obj|
786
- obj.should_receive(:update).with(:template => json, :parameters=>{"InstanceType"=>"m1.large", "EncryptionPassword"=>"KioqKioqKioqKioqKioqKg=="})
787
- obj.should_receive(:status).and_return(
843
+ expect(obj).to receive(:update).with(:template => json, :parameters=>{"InstanceType"=>"m1.large", "EncryptionPassword"=>"KioqKioqKioqKioqKioqKg=="})
844
+ expect(obj).to receive(:status).and_return(
788
845
  'UPDATE_COMPLETE', 'UPDATE_COMPLETE', 'UPDATE_COMPLETE')
789
- obj.should_receive(:outputs) { [output] }
790
- obj.should_receive(:resource_summaries) { [resource_summary] }
846
+ expect(obj).to receive(:outputs) { [output] }
847
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
791
848
  end
792
849
 
793
850
  stacks = make_double('stacks') do |obj|
794
- obj.should_receive(:[])
851
+ expect(obj).to receive(:[])
795
852
  .with('MyStack') { stack }
796
853
  end
797
854
 
798
- cf.should_receive(:stacks) { stacks }
855
+ expect(cf).to receive(:stacks) { stacks }
799
856
  end
800
857
  end
801
858
  end