kumogata 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3d4297faba5052990897c2b20bff4f2df6596c6
4
- data.tar.gz: 85f974cbb9005965628da8426ee9dc388ca526a9
3
+ metadata.gz: 19f66a07b454ab92e7351753a201b112702efcc7
4
+ data.tar.gz: 189130373b0ba7b733acf56ddb4cafc296ccd907
5
5
  SHA512:
6
- metadata.gz: 389adcc45a93fb312a3d3bcc30ad44c677d25e0be5b7a9af1cd08462acf83e9a31a9854abf7247b55a483f7944747e8e226882b367225669fb6c045fe02975b9
7
- data.tar.gz: e9353c00726d0b8699f1957239d17ac51dae691408f3af041a2dc0fd7501522f82e3ee00de3c695c359f217b7d96508c64e722656fec529b275235d962e4380d
6
+ metadata.gz: 66df3ba400dcbb14e5888e3dd125406c594e514633cb6fb3329d02bd85c08c4aa4c5dcfe659392a6b3753a261326272e227a3a241beba68a6df12d6b8a5f2946
7
+ data.tar.gz: 1aa6c374292cf938e5cd2e7d29044dcdc34c0fe444c9ce3a70df1044680a902cd3c1738602eacd43b0f9794cfb6614a2b2ea4987557aa4ac699be94c3e5188e2
data/README.md CHANGED
@@ -98,6 +98,7 @@ Options:
98
98
  --skip-replace-underscore
99
99
  --deletion-policy-retain
100
100
  -p, --parameters KEY_VALUES
101
+ -j, --json-parameters JSON
101
102
  -e, --encrypt-parameters KEYS
102
103
  --encryption-password PASS
103
104
  --skip-send-password
@@ -113,6 +114,7 @@ Options:
113
114
  --color
114
115
  --no-color
115
116
  --debug
117
+ -v, --verbose
116
118
  ```
117
119
 
118
120
  ### KUMOGATA_OPTIONS
@@ -107,6 +107,7 @@ class Kumogata::ArgumentParser
107
107
  opt.on('' , '--color') { options[:color] = true }
108
108
  opt.on('' , '--no-color') { options[:color] = false }
109
109
  opt.on('' , '--debug') { options[:debug] = true }
110
+ opt.on('-v', '--verbose') { options[:verbose] = true }
110
111
  opt.parse!
111
112
 
112
113
  unless (command = ARGV.shift)
@@ -521,6 +521,11 @@ class Kumogata::Client
521
521
  def build_update_options(template)
522
522
  opts = {:template => template}
523
523
  add_parameters(opts)
524
+
525
+ [:capabilities].each do |k|
526
+ opts[k] = @options[k] if @options[k]
527
+ end
528
+
524
529
  return opts
525
530
  end
526
531
 
@@ -589,6 +594,10 @@ class Kumogata::Client
589
594
  end
590
595
 
591
596
  Kumogata.logger.info('Template validated successfully'.green)
597
+
598
+ if @options.verbose
599
+ Kumogata.logger.info(JSON.pretty_generate(JSON.parse(result.to_json)).colorize_as(:json))
600
+ end
592
601
  end
593
602
 
594
603
  def events_for(stack)
@@ -1,3 +1,3 @@
1
1
  module Kumogata
2
- VERSION = '0.5.2'
2
+ VERSION = '0.5.3'
3
3
  end
@@ -22,40 +22,40 @@ end
22
22
 
23
23
  run_client(:create, :template => template) do |client, cf|
24
24
  json = eval_template(template, :update_deletion_policy => true).to_json
25
- client.should_receive(:print_event_log).twice
26
- client.should_receive(:create_event_log).once
25
+ expect(client).to receive(:print_event_log).twice
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) { 'CREATE_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) { 'CREATE_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(:status).and_return(
43
+ expect(obj).to receive(:status).and_return(
44
44
  'CREATE_COMPLETE', 'CREATE_COMPLETE',
45
45
  'DELETE_COMPLETE', 'DELETE_COMPLETE', 'DELETE_COMPLETE')
46
- obj.should_receive(:outputs) { [output] }
47
- obj.should_receive(:resource_summaries) { [resource_summary] }
48
- obj.should_receive(:delete)
46
+ expect(obj).to receive(:outputs) { [output] }
47
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
48
+ expect(obj).to receive(:delete)
49
49
  end
50
50
 
51
51
  stacks = make_double('stacks') do |obj|
52
- obj.should_receive(:create)
52
+ expect(obj).to receive(:create)
53
53
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', json, {}) { stack }
54
- obj.should_receive(:[])
54
+ expect(obj).to receive(:[])
55
55
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX') { stack }
56
56
  end
57
57
 
58
- cf.should_receive(:stacks).twice { stacks }
58
+ expect(cf).to receive(:stacks).twice { stacks }
59
59
  end
60
60
  end
61
61
 
@@ -82,23 +82,23 @@ end
82
82
 
83
83
  out = run_client(:create, :template => template, :options => {:detach => true}) do |client, cf|
84
84
  json = eval_template(template, :update_deletion_policy => true).to_json
85
- client.should_not_receive(:print_event_log)
86
- client.should_not_receive(:create_event_log)
85
+ expect(client).not_to receive(:print_event_log)
86
+ expect(client).not_to receive(:create_event_log)
87
87
 
88
88
  stack = make_double('stack') do |obj|
89
- obj.should_not_receive(:status)
90
- obj.should_not_receive(:outputs)
91
- obj.should_not_receive(:resource_summaries)
92
- obj.should_not_receive(:delete)
89
+ expect(obj).not_to receive(:status)
90
+ expect(obj).not_to receive(:outputs)
91
+ expect(obj).not_to receive(:resource_summaries)
92
+ expect(obj).not_to receive(:delete)
93
93
  end
94
94
 
95
95
  stacks = make_double('stacks') do |obj|
96
- obj.should_receive(:create)
96
+ expect(obj).to receive(:create)
97
97
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', json, {}) { stack }
98
- obj.should_not_receive(:[])
98
+ expect(obj).not_to receive(:[])
99
99
  end
100
100
 
101
- cf.should_receive(:stacks).once { stacks }
101
+ expect(cf).to receive(:stacks).once { stacks }
102
102
  end
103
103
 
104
104
  expect(out).to be_nil
@@ -148,72 +148,72 @@ end
148
148
 
149
149
  run_client(:create, :template => template) do |client, cf|
150
150
  json = eval_template(template, :update_deletion_policy => true).to_json
151
- client.should_receive(:print_event_log).twice
152
- client.should_receive(:create_event_log).once
151
+ expect(client).to receive(:print_event_log).twice
152
+ expect(client).to receive(:create_event_log).once
153
153
 
154
154
  output1 = make_double('output') do |obj|
155
- obj.should_receive(:key) { 'AZ' }
156
- obj.should_receive(:value) { 'ap-northeast-1b' }
155
+ expect(obj).to receive(:key) { 'AZ' }
156
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
157
157
  end
158
158
 
159
159
  output2 = make_double('output') do |obj|
160
- obj.should_receive(:key) { 'Region' }
161
- obj.should_receive(:value) { 'ap-northeast-1' }
160
+ expect(obj).to receive(:key) { 'Region' }
161
+ expect(obj).to receive(:value) { 'ap-northeast-1' }
162
162
  end
163
163
 
164
164
  resource_summary = make_double('resource_summary') do |obj|
165
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
166
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
167
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
168
- obj.should_receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
169
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
170
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
165
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
166
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
167
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
168
+ expect(obj).to receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
169
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
170
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
171
171
  end
172
172
 
173
173
  stack = make_double('stack') do |obj|
174
- obj.should_receive(:status).and_return(
174
+ expect(obj).to receive(:status).and_return(
175
175
  'CREATE_COMPLETE', 'CREATE_COMPLETE',
176
176
  'DELETE_COMPLETE', 'DELETE_COMPLETE', 'DELETE_COMPLETE')
177
- obj.should_receive(:outputs) { [output1, output2] }
178
- obj.should_receive(:resource_summaries) { [resource_summary] }
179
- obj.should_receive(:delete)
177
+ expect(obj).to receive(:outputs) { [output1, output2] }
178
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
179
+ expect(obj).to receive(:delete)
180
180
  end
181
181
 
182
182
  stacks = make_double('stacks') do |obj|
183
- obj.should_receive(:create)
183
+ expect(obj).to receive(:create)
184
184
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', json, {}) { stack }
185
- obj.should_receive(:[])
185
+ expect(obj).to receive(:[])
186
186
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX') { stack }
187
187
  end
188
188
 
189
- cf.should_receive(:stacks).twice { stacks }
189
+ expect(cf).to receive(:stacks).twice { stacks }
190
190
 
191
- process_status1 = make_double('process_status1') {|obj| obj.should_receive(:to_i).and_return(0) }
192
- process_status2 = make_double('process_status2') {|obj| obj.should_receive(:to_i).and_return(0) }
191
+ process_status1 = make_double('process_status1') {|obj| expect(obj).to receive(:to_i).and_return(0) }
192
+ process_status2 = make_double('process_status2') {|obj| expect(obj).to receive(:to_i).and_return(0) }
193
193
 
194
- client.instance_variable_get(:@post_processing)
195
- .should_receive(:run_shell_command)
194
+ expect(client.instance_variable_get(:@post_processing))
195
+ .to receive(:run_shell_command)
196
196
  .with(" echo <%= Key \"AZ\" %>\n echo <%= Key \"Region\" %>\n", {"AZ"=>"ap-northeast-1b", "Region"=>"ap-northeast-1"})
197
197
  .and_return(["ap-northeast-1b\nap-northeast-1\n", "", process_status1])
198
- client.instance_variable_get(:@post_processing)
199
- .should_receive(:run_shell_command)
198
+ expect(client.instance_variable_get(:@post_processing))
199
+ .to receive(:run_shell_command)
200
200
  .with(" echo <%= Key \"Region\" %>\n echo <%= Key \"AZ\" %>\n", {"AZ"=>"ap-northeast-1b", "Region"=>"ap-northeast-1"})
201
201
  .and_return(["ap-northeast-1\nap-northeast-1b\n", "", process_status2])
202
202
 
203
- client.instance_variable_get(:@post_processing)
204
- .should_receive(:print_command).with('command_a')
205
- client.instance_variable_get(:@post_processing)
206
- .should_receive(:print_command).with('command_b')
203
+ expect(client.instance_variable_get(:@post_processing))
204
+ .to receive(:print_command).with('command_a')
205
+ expect(client.instance_variable_get(:@post_processing))
206
+ .to receive(:print_command).with('command_b')
207
207
 
208
- client.instance_variable_get(:@post_processing)
209
- .should_receive(:print_command_result)
208
+ expect(client.instance_variable_get(:@post_processing))
209
+ .to receive(:print_command_result)
210
210
  .with("ap-northeast-1b\nap-northeast-1\n", "", process_status1)
211
- client.instance_variable_get(:@post_processing)
212
- .should_receive(:print_command_result)
211
+ expect(client.instance_variable_get(:@post_processing))
212
+ .to receive(:print_command_result)
213
213
  .with("ap-northeast-1\nap-northeast-1b\n", "", process_status2)
214
214
 
215
- client.instance_variable_get(:@post_processing)
216
- .should_receive(:save_command_results)
215
+ expect(client.instance_variable_get(:@post_processing))
216
+ .to receive(:save_command_results)
217
217
  .with([{'command_a' => {'ExitStatus' => 0, 'StdOut' => "ap-northeast-1b\nap-northeast-1\n", 'StdErr' => ""}},
218
218
  {'command_b' => {'ExitStatus' => 0, 'StdOut' => "ap-northeast-1\nap-northeast-1b\n", 'StdErr' => ""}}])
219
219
  end
@@ -254,55 +254,55 @@ end
254
254
 
255
255
  run_client(:create, :template => template) do |client, cf|
256
256
  json = eval_template(template, :update_deletion_policy => true).to_json
257
- client.should_receive(:print_event_log).twice
258
- client.should_receive(:create_event_log).once
257
+ expect(client).to receive(:print_event_log).twice
258
+ expect(client).to receive(:create_event_log).once
259
259
 
260
260
  output = make_double('output') do |obj|
261
- obj.should_receive(:key) { 'PublicIp' }
262
- obj.should_receive(:value) { '127.0.0.1' }
261
+ expect(obj).to receive(:key) { 'PublicIp' }
262
+ expect(obj).to receive(:value) { '127.0.0.1' }
263
263
  end
264
264
 
265
265
  resource_summary = make_double('resource_summary') do |obj|
266
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
267
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
268
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
269
- obj.should_receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
270
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
271
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
266
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
267
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
268
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
269
+ expect(obj).to receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
270
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
271
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
272
272
  end
273
273
 
274
274
  stack = make_double('stack') do |obj|
275
- obj.should_receive(:status).and_return(
275
+ expect(obj).to receive(:status).and_return(
276
276
  'CREATE_COMPLETE', 'CREATE_COMPLETE',
277
277
  'DELETE_COMPLETE', 'DELETE_COMPLETE', 'DELETE_COMPLETE')
278
- obj.should_receive(:outputs) { [output] }
279
- obj.should_receive(:resource_summaries) { [resource_summary] }
280
- obj.should_receive(:delete)
278
+ expect(obj).to receive(:outputs) { [output] }
279
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
280
+ expect(obj).to receive(:delete)
281
281
  end
282
282
 
283
283
  stacks = make_double('stacks') do |obj|
284
- obj.should_receive(:create)
284
+ expect(obj).to receive(:create)
285
285
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', json, {}) { stack }
286
- obj.should_receive(:[])
286
+ expect(obj).to receive(:[])
287
287
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX') { stack }
288
288
  end
289
289
 
290
- cf.should_receive(:stacks).twice { stacks }
290
+ expect(cf).to receive(:stacks).twice { stacks }
291
291
 
292
- client.instance_variable_get(:@post_processing)
293
- .should_receive(:run_ssh_command)
292
+ expect(client.instance_variable_get(:@post_processing))
293
+ .to receive(:run_ssh_command)
294
294
  .with({"host"=>"<%= Key \"PublicIp\" %>", "user"=>"ec2-user", "request_pty"=>true}, " ls\n", {"PublicIp"=>"127.0.0.1"})
295
295
  .and_return(["file1\nfile2\n", "", 0])
296
296
 
297
- client.instance_variable_get(:@post_processing)
298
- .should_receive(:print_command).with('ssh_command')
297
+ expect(client.instance_variable_get(:@post_processing))
298
+ .to receive(:print_command).with('ssh_command')
299
299
 
300
- client.instance_variable_get(:@post_processing)
301
- .should_receive(:print_command_result)
300
+ expect(client.instance_variable_get(:@post_processing))
301
+ .to receive(:print_command_result)
302
302
  .with("file1\nfile2\n", "", 0)
303
303
 
304
- client.instance_variable_get(:@post_processing)
305
- .should_receive(:save_command_results)
304
+ expect(client.instance_variable_get(:@post_processing))
305
+ .to receive(:save_command_results)
306
306
  .with([{'ssh_command' => {'ExitStatus' => 0, 'StdOut' => "file1\nfile2\n", 'StdErr' => ""}}])
307
307
  end
308
308
  end
@@ -346,55 +346,55 @@ end
346
346
 
347
347
  run_client(:create, :template => template) do |client, cf|
348
348
  json = eval_template(template, :update_deletion_policy => true).to_json
349
- client.should_receive(:print_event_log).twice
350
- client.should_receive(:create_event_log).once
349
+ expect(client).to receive(:print_event_log).twice
350
+ expect(client).to receive(:create_event_log).once
351
351
 
352
352
  output = make_double('output') do |obj|
353
- obj.should_receive(:key) { 'PublicIp' }
354
- obj.should_receive(:value) { '127.0.0.1' }
353
+ expect(obj).to receive(:key) { 'PublicIp' }
354
+ expect(obj).to receive(:value) { '127.0.0.1' }
355
355
  end
356
356
 
357
357
  resource_summary = make_double('resource_summary') do |obj|
358
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
359
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
360
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
361
- obj.should_receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
362
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
363
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
358
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
359
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
360
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
361
+ expect(obj).to receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
362
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
363
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
364
364
  end
365
365
 
366
366
  stack = make_double('stack') do |obj|
367
- obj.should_receive(:status).and_return(
367
+ expect(obj).to receive(:status).and_return(
368
368
  'CREATE_COMPLETE', 'CREATE_COMPLETE',
369
369
  'DELETE_COMPLETE', 'DELETE_COMPLETE', 'DELETE_COMPLETE')
370
- obj.should_receive(:outputs) { [output] }
371
- obj.should_receive(:resource_summaries) { [resource_summary] }
372
- obj.should_receive(:delete)
370
+ expect(obj).to receive(:outputs) { [output] }
371
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
372
+ expect(obj).to receive(:delete)
373
373
  end
374
374
 
375
375
  stacks = make_double('stacks') do |obj|
376
- obj.should_receive(:create)
376
+ expect(obj).to receive(:create)
377
377
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', json, {}) { stack }
378
- obj.should_receive(:[])
378
+ expect(obj).to receive(:[])
379
379
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX') { stack }
380
380
  end
381
381
 
382
- cf.should_receive(:stacks).twice { stacks }
382
+ expect(cf).to receive(:stacks).twice { stacks }
383
383
 
384
- client.instance_variable_get(:@post_processing)
385
- .should_receive(:run_ssh_command)
384
+ expect(client.instance_variable_get(:@post_processing))
385
+ .to receive(:run_ssh_command)
386
386
  .with({"host"=>"<%= Key \"PublicIp\" %>", "user"=>"ec2-user", "request_pty"=>true}, " ls\n", {"PublicIp"=>"127.0.0.1", "MyOutput"=>100})
387
387
  .and_return(["file1\nfile2\n", "", 0])
388
388
 
389
- client.instance_variable_get(:@post_processing)
390
- .should_receive(:print_command).with('ssh_command')
389
+ expect(client.instance_variable_get(:@post_processing))
390
+ .to receive(:print_command).with('ssh_command')
391
391
 
392
- client.instance_variable_get(:@post_processing)
393
- .should_receive(:print_command_result)
392
+ expect(client.instance_variable_get(:@post_processing))
393
+ .to receive(:print_command_result)
394
394
  .with("file1\nfile2\n", "", 0)
395
395
 
396
- client.instance_variable_get(:@post_processing)
397
- .should_receive(:save_command_results)
396
+ expect(client.instance_variable_get(:@post_processing))
397
+ .to receive(:save_command_results)
398
398
  .with([{'ssh_command' => {'ExitStatus' => 0, 'StdOut' => "file1\nfile2\n", 'StdErr' => ""}}])
399
399
  end
400
400
  end
@@ -445,72 +445,72 @@ end
445
445
 
446
446
  run_client(:create, :template => template) do |client, cf|
447
447
  json = eval_template(template, :update_deletion_policy => true).to_json
448
- client.should_receive(:print_event_log).twice
449
- client.should_receive(:create_event_log).once
448
+ expect(client).to receive(:print_event_log).twice
449
+ expect(client).to receive(:create_event_log).once
450
450
 
451
451
  output1 = make_double('output') do |obj|
452
- obj.should_receive(:key) { 'AZ' }
453
- obj.should_receive(:value) { 'ap-northeast-1b' }
452
+ expect(obj).to receive(:key) { 'AZ' }
453
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
454
454
  end
455
455
 
456
456
  output2 = make_double('output') do |obj|
457
- obj.should_receive(:key) { 'Region' }
458
- obj.should_receive(:value) { 'ap-northeast-1' }
457
+ expect(obj).to receive(:key) { 'Region' }
458
+ expect(obj).to receive(:value) { 'ap-northeast-1' }
459
459
  end
460
460
 
461
461
  resource_summary = make_double('resource_summary') do |obj|
462
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
463
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
464
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
465
- obj.should_receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
466
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
467
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
462
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
463
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
464
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
465
+ expect(obj).to receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
466
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
467
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
468
468
  end
469
469
 
470
470
  stack = make_double('stack') do |obj|
471
- obj.should_receive(:status).and_return(
471
+ expect(obj).to receive(:status).and_return(
472
472
  'CREATE_COMPLETE', 'CREATE_COMPLETE',
473
473
  'DELETE_COMPLETE', 'DELETE_COMPLETE', 'DELETE_COMPLETE')
474
- obj.should_receive(:outputs) { [output1, output2] }
475
- obj.should_receive(:resource_summaries) { [resource_summary] }
476
- obj.should_receive(:delete)
474
+ expect(obj).to receive(:outputs) { [output1, output2] }
475
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
476
+ expect(obj).to receive(:delete)
477
477
  end
478
478
 
479
479
  stacks = make_double('stacks') do |obj|
480
- obj.should_receive(:create)
480
+ expect(obj).to receive(:create)
481
481
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', json, {}) { stack }
482
- obj.should_receive(:[])
482
+ expect(obj).to receive(:[])
483
483
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX') { stack }
484
484
  end
485
485
 
486
- cf.should_receive(:stacks).twice { stacks }
486
+ expect(cf).to receive(:stacks).twice { stacks }
487
487
 
488
- process_status1 = make_double('process_status1') {|obj| obj.should_receive(:to_i).and_return(0) }
489
- process_status2 = make_double('process_status2') {|obj| obj.should_receive(:to_i).and_return(0) }
488
+ process_status1 = make_double('process_status1') {|obj| expect(obj).to receive(:to_i).and_return(0) }
489
+ process_status2 = make_double('process_status2') {|obj| expect(obj).to receive(:to_i).and_return(0) }
490
490
 
491
- client.instance_variable_get(:@post_processing)
492
- .should_receive(:run_shell_command)
491
+ expect(client.instance_variable_get(:@post_processing))
492
+ .to receive(:run_shell_command)
493
493
  .with(" echo <%= Key \"AZ\" %>\n echo <%= Key \"Region\" %>\n", {"AZ"=>"ap-northeast-1b", "Region"=>"ap-northeast-1"})
494
494
  .and_return(["ap-northeast-1b\nap-northeast-1\n", "", process_status1])
495
- client.instance_variable_get(:@post_processing)
496
- .should_receive(:run_shell_command)
495
+ expect(client.instance_variable_get(:@post_processing))
496
+ .to receive(:run_shell_command)
497
497
  .with(" echo <%= Key \"Region\" %>\n echo <%= Key \"AZ\" %>\n", {"AZ"=>"ap-northeast-1b", "Region"=>"ap-northeast-1"})
498
498
  .and_return(["ap-northeast-1\nap-northeast-1b\n", "", process_status2])
499
499
 
500
- client.instance_variable_get(:@post_processing)
501
- .should_receive(:print_command).with('command_a')
502
- client.instance_variable_get(:@post_processing)
503
- .should_receive(:print_command).with('command_b')
500
+ expect(client.instance_variable_get(:@post_processing))
501
+ .to receive(:print_command).with('command_a')
502
+ expect(client.instance_variable_get(:@post_processing))
503
+ .to receive(:print_command).with('command_b')
504
504
 
505
- client.instance_variable_get(:@post_processing)
506
- .should_receive(:print_command_result)
505
+ expect(client.instance_variable_get(:@post_processing))
506
+ .to receive(:print_command_result)
507
507
  .with("ap-northeast-1b\nap-northeast-1\n", "", process_status1)
508
- client.instance_variable_get(:@post_processing)
509
- .should_receive(:print_command_result)
508
+ expect(client.instance_variable_get(:@post_processing))
509
+ .to receive(:print_command_result)
510
510
  .with("ap-northeast-1\nap-northeast-1b\n", "", process_status2)
511
511
 
512
- client.instance_variable_get(:@post_processing)
513
- .should_receive(:save_command_results)
512
+ expect(client.instance_variable_get(:@post_processing))
513
+ .to receive(:save_command_results)
514
514
  .with([{'command_a' => {'ExitStatus' => 0, 'StdOut' => "ap-northeast-1b\nap-northeast-1\n", 'StdErr' => ""}},
515
515
  {'command_b' => {'ExitStatus' => 0, 'StdOut' => "ap-northeast-1\nap-northeast-1b\n", 'StdErr' => ""}}])
516
516
  end
@@ -562,53 +562,53 @@ end
562
562
 
563
563
  run_client(:create, :template => template) do |client, cf|
564
564
  json = eval_template(template, :update_deletion_policy => true).to_json
565
- client.should_receive(:print_event_log).twice
566
- client.should_receive(:create_event_log).once
565
+ expect(client).to receive(:print_event_log).twice
566
+ expect(client).to receive(:create_event_log).once
567
567
 
568
568
  output1 = make_double('output') do |obj|
569
- obj.should_receive(:key) { 'AZ' }
570
- obj.should_receive(:value) { 'ap-northeast-1b' }
569
+ expect(obj).to receive(:key) { 'AZ' }
570
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
571
571
  end
572
572
 
573
573
  output2 = make_double('output') do |obj|
574
- obj.should_receive(:key) { 'Region' }
575
- obj.should_receive(:value) { 'ap-northeast-1' }
574
+ expect(obj).to receive(:key) { 'Region' }
575
+ expect(obj).to receive(:value) { 'ap-northeast-1' }
576
576
  end
577
577
 
578
578
  resource_summary = make_double('resource_summary') do |obj|
579
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
580
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
581
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
582
- obj.should_receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
583
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
584
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
579
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
580
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
581
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
582
+ expect(obj).to receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
583
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
584
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
585
585
  end
586
586
 
587
587
  stack = make_double('stack') do |obj|
588
- obj.should_receive(:status).and_return(
588
+ expect(obj).to receive(:status).and_return(
589
589
  'CREATE_COMPLETE', 'CREATE_COMPLETE',
590
590
  'DELETE_COMPLETE', 'DELETE_COMPLETE', 'DELETE_COMPLETE')
591
- obj.should_receive(:outputs) { [output1, output2] }
592
- obj.should_receive(:resource_summaries) { [resource_summary] }
593
- obj.should_receive(:delete)
591
+ expect(obj).to receive(:outputs) { [output1, output2] }
592
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
593
+ expect(obj).to receive(:delete)
594
594
  end
595
595
 
596
596
  stacks = make_double('stacks') do |obj|
597
- obj.should_receive(:create)
597
+ expect(obj).to receive(:create)
598
598
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', json, {}) { stack }
599
- obj.should_receive(:[])
599
+ expect(obj).to receive(:[])
600
600
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX') { stack }
601
601
  end
602
602
 
603
- cf.should_receive(:stacks).twice { stacks }
603
+ expect(cf).to receive(:stacks).twice { stacks }
604
604
 
605
- Open3.should_not_receive(:capture3)
605
+ expect(Open3).not_to receive(:capture3)
606
606
 
607
- client.instance_variable_get(:@post_processing)
608
- .should_not_receive(:print_command_result)
607
+ expect(client.instance_variable_get(:@post_processing))
608
+ .not_to receive(:print_command_result)
609
609
 
610
- client.instance_variable_get(:@post_processing)
611
- .should_not_receive(:save_command_results)
610
+ expect(client.instance_variable_get(:@post_processing))
611
+ .not_to receive(:save_command_results)
612
612
  end
613
613
  end
614
614
 
@@ -638,40 +638,40 @@ end
638
638
  template = eval_template(template, :update_deletion_policy => true)
639
639
  expect(template['Resources']['myEC2Instance']['DeletionPolicy']).to eq('Delete')
640
640
  json = template.to_json
641
- client.should_receive(:print_event_log).twice
642
- client.should_receive(:create_event_log).once
641
+ expect(client).to receive(:print_event_log).twice
642
+ expect(client).to receive(:create_event_log).once
643
643
 
644
644
  output = make_double('output') do |obj|
645
- obj.should_receive(:key) { 'AZ' }
646
- obj.should_receive(:value) { 'ap-northeast-1b' }
645
+ expect(obj).to receive(:key) { 'AZ' }
646
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
647
647
  end
648
648
 
649
649
  resource_summary = make_double('resource_summary') do |obj|
650
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
651
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
652
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
653
- obj.should_receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
654
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
655
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
650
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
651
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
652
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
653
+ expect(obj).to receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
654
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
655
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
656
656
  end
657
657
 
658
658
  stack = make_double('stack') do |obj|
659
- obj.should_receive(:status).and_return(
659
+ expect(obj).to receive(:status).and_return(
660
660
  'CREATE_COMPLETE', 'CREATE_COMPLETE',
661
661
  'DELETE_COMPLETE', 'DELETE_COMPLETE', 'DELETE_COMPLETE')
662
- obj.should_receive(:outputs) { [output] }
663
- obj.should_receive(:resource_summaries) { [resource_summary] }
664
- obj.should_receive(:delete)
662
+ expect(obj).to receive(:outputs) { [output] }
663
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
664
+ expect(obj).to receive(:delete)
665
665
  end
666
666
 
667
667
  stacks = make_double('stacks') do |obj|
668
- obj.should_receive(:create)
668
+ expect(obj).to receive(:create)
669
669
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', json, {}) { stack }
670
- obj.should_receive(:[])
670
+ expect(obj).to receive(:[])
671
671
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX') { stack }
672
672
  end
673
673
 
674
- cf.should_receive(:stacks).twice { stacks }
674
+ expect(cf).to receive(:stacks).twice { stacks }
675
675
  end
676
676
  end
677
677
 
@@ -706,40 +706,40 @@ end
706
706
 
707
707
  run_client(:create, :template => template, :options => {:parameters => {'InstanceType'=>'m1.large'}}) do |client, cf|
708
708
  json = eval_template(template, :update_deletion_policy => true).to_json
709
- client.should_receive(:print_event_log).twice
710
- client.should_receive(:create_event_log).once
709
+ expect(client).to receive(:print_event_log).twice
710
+ expect(client).to receive(:create_event_log).once
711
711
 
712
712
  output = make_double('output') do |obj|
713
- obj.should_receive(:key) { 'AZ' }
714
- obj.should_receive(:value) { 'ap-northeast-1b' }
713
+ expect(obj).to receive(:key) { 'AZ' }
714
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
715
715
  end
716
716
 
717
717
  resource_summary = make_double('resource_summary') do |obj|
718
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
719
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
720
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
721
- obj.should_receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
722
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
723
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
718
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
719
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
720
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
721
+ expect(obj).to receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
722
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
723
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
724
724
  end
725
725
 
726
726
  stack = make_double('stack') do |obj|
727
- obj.should_receive(:status).and_return(
727
+ expect(obj).to receive(:status).and_return(
728
728
  'CREATE_COMPLETE', 'CREATE_COMPLETE',
729
729
  'DELETE_COMPLETE', 'DELETE_COMPLETE', 'DELETE_COMPLETE')
730
- obj.should_receive(:outputs) { [output] }
731
- obj.should_receive(:resource_summaries) { [resource_summary] }
732
- obj.should_receive(:delete)
730
+ expect(obj).to receive(:outputs) { [output] }
731
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
732
+ expect(obj).to receive(:delete)
733
733
  end
734
734
 
735
735
  stacks = make_double('stacks') do |obj|
736
- obj.should_receive(:create)
736
+ expect(obj).to receive(:create)
737
737
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', json, {:parameters=>{"InstanceType"=>"m1.large"}}) { stack }
738
- obj.should_receive(:[])
738
+ expect(obj).to receive(:[])
739
739
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX') { stack }
740
740
  end
741
741
 
742
- cf.should_receive(:stacks).twice { stacks }
742
+ expect(cf).to receive(:stacks).twice { stacks }
743
743
  end
744
744
  end
745
745
 
@@ -766,36 +766,36 @@ end
766
766
 
767
767
  run_client(:create, :arguments => ['MyStack'], :template => template) do |client, cf|
768
768
  json = eval_template(template).to_json
769
- client.should_receive(:print_event_log).once
769
+ expect(client).to receive(:print_event_log).once
770
770
 
771
771
  output = make_double('output') do |obj|
772
- obj.should_receive(:key) { 'AZ' }
773
- obj.should_receive(:value) { 'ap-northeast-1b' }
772
+ expect(obj).to receive(:key) { 'AZ' }
773
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
774
774
  end
775
775
 
776
776
  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) { 'CREATE_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' }
777
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
778
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
779
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
780
+ expect(obj).to receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
781
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
782
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
783
783
  end
784
784
 
785
785
  stack = make_double('stack') do |obj|
786
- obj.should_receive(:status).and_return(
786
+ expect(obj).to receive(:status).and_return(
787
787
  'CREATE_COMPLETE',
788
788
  'CREATE_COMPLETE')
789
- obj.should_receive(:outputs) { [output] }
790
- obj.should_receive(:resource_summaries) { [resource_summary] }
789
+ expect(obj).to receive(:outputs) { [output] }
790
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
791
791
  end
792
792
 
793
793
  stacks = make_double('status') do |obj|
794
- obj.should_receive(:create)
794
+ expect(obj).to receive(:create)
795
795
  .with('MyStack', json, {}) { stack }
796
796
  end
797
797
 
798
- cf.should_receive(:stacks) { stacks }
798
+ expect(cf).to receive(:stacks) { stacks }
799
799
  end
800
800
  end
801
801
 
@@ -822,36 +822,36 @@ end
822
822
 
823
823
  run_client(:create, :arguments => ['MyStack'], :template => template, :options => {:deletion_policy_retain => true}) do |client, cf|
824
824
  json = eval_template(template, :update_deletion_policy => true).to_json
825
- client.should_receive(:print_event_log).once
825
+ expect(client).to receive(:print_event_log).once
826
826
 
827
827
  output = make_double('output') do |obj|
828
- obj.should_receive(:key) { 'AZ' }
829
- obj.should_receive(:value) { 'ap-northeast-1b' }
828
+ expect(obj).to receive(:key) { 'AZ' }
829
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
830
830
  end
831
831
 
832
832
  resource_summary = make_double('resource_summary') do |obj|
833
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
834
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
835
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
836
- obj.should_receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
837
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
838
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
833
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
834
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
835
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
836
+ expect(obj).to receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
837
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
838
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
839
839
  end
840
840
 
841
841
  stack = make_double('stack') do |obj|
842
- obj.should_receive(:status).and_return(
842
+ expect(obj).to receive(:status).and_return(
843
843
  'CREATE_COMPLETE',
844
844
  'CREATE_COMPLETE')
845
- obj.should_receive(:outputs) { [output] }
846
- obj.should_receive(:resource_summaries) { [resource_summary] }
845
+ expect(obj).to receive(:outputs) { [output] }
846
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
847
847
  end
848
848
 
849
849
  stacks = make_double('status') do |obj|
850
- obj.should_receive(:create)
850
+ expect(obj).to receive(:create)
851
851
  .with('MyStack', json, {}) { stack }
852
852
  end
853
853
 
854
- cf.should_receive(:stacks) { stacks }
854
+ expect(cf).to receive(:stacks) { stacks }
855
855
  end
856
856
  end
857
857
 
@@ -912,40 +912,40 @@ end
912
912
 
913
913
  run_client(:create, :template => template, :options => {:parameters => {'InstanceType'=>'m1.large'}, :encrypt_parameters => ['Password']}) do |client, cf|
914
914
  json = eval_template(template, :update_deletion_policy => true, :add_encryption_password => true).to_json
915
- client.should_receive(:print_event_log).twice
916
- client.should_receive(:create_event_log).once
915
+ expect(client).to receive(:print_event_log).twice
916
+ expect(client).to receive(:create_event_log).once
917
917
 
918
918
  output = make_double('output') do |obj|
919
- obj.should_receive(:key) { 'AZ' }
920
- obj.should_receive(:value) { 'ap-northeast-1b' }
919
+ expect(obj).to receive(:key) { 'AZ' }
920
+ expect(obj).to receive(:value) { 'ap-northeast-1b' }
921
921
  end
922
922
 
923
923
  resource_summary = make_double('resource_summary') do |obj|
924
- obj.should_receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
925
- obj.should_receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
926
- obj.should_receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
927
- obj.should_receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
928
- obj.should_receive(:[]).with(:resource_status_reason) { nil }
929
- obj.should_receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
924
+ expect(obj).to receive(:[]).with(:logical_resource_id) { 'myEC2Instance' }
925
+ expect(obj).to receive(:[]).with(:physical_resource_id) { 'i-XXXXXXXX' }
926
+ expect(obj).to receive(:[]).with(:resource_type) { 'AWS::EC2::Instance' }
927
+ expect(obj).to receive(:[]).with(:resource_status) { 'CREATE_COMPLETE' }
928
+ expect(obj).to receive(:[]).with(:resource_status_reason) { nil }
929
+ expect(obj).to receive(:[]).with(:last_updated_timestamp) { '2014-03-02 04:35:12 UTC' }
930
930
  end
931
931
 
932
932
  stack = make_double('stack') do |obj|
933
- obj.should_receive(:status).and_return(
933
+ expect(obj).to receive(:status).and_return(
934
934
  'CREATE_COMPLETE', 'CREATE_COMPLETE',
935
935
  'DELETE_COMPLETE', 'DELETE_COMPLETE', 'DELETE_COMPLETE')
936
- obj.should_receive(:outputs) { [output] }
937
- obj.should_receive(:resource_summaries) { [resource_summary] }
938
- obj.should_receive(:delete)
936
+ expect(obj).to receive(:outputs) { [output] }
937
+ expect(obj).to receive(:resource_summaries) { [resource_summary] }
938
+ expect(obj).to receive(:delete)
939
939
  end
940
940
 
941
941
  stacks = make_double('stacks') do |obj|
942
- obj.should_receive(:create)
942
+ expect(obj).to receive(:create)
943
943
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', json, {:parameters=>{"InstanceType"=>"m1.large", "EncryptionPassword"=>"KioqKioqKioqKioqKioqKg=="}}) { stack }
944
- obj.should_receive(:[])
944
+ expect(obj).to receive(:[])
945
945
  .with('kumogata-user-host-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX') { stack }
946
946
  end
947
947
 
948
- cf.should_receive(:stacks).twice { stacks }
948
+ expect(cf).to receive(:stacks).twice { stacks }
949
949
  end
950
950
  end
951
951
  end