tugboat 2.2.4 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +284 -274
- data/README.md +1 -1
- data/features/cassettes/config/Array_of_SSH_Keys_in_Config.yml +1 -1
- data/features/cassettes/config/Single_SSH_key_as_number_in_config.yml +1 -1
- data/lib/tugboat.rb +4 -0
- data/lib/tugboat/middleware/create_droplet.rb +1 -1
- data/lib/tugboat/middleware/custom_logger.rb +3 -1
- data/lib/tugboat/middleware/inject_client.rb +3 -0
- data/lib/tugboat/middleware/list_regions.rb +2 -2
- data/lib/tugboat/middleware/list_sizes.rb +2 -2
- data/lib/tugboat/version.rb +1 -1
- data/license/dependency_decisions.yml +6 -0
- data/spec/cli/authorize_cli_spec.rb +2 -2
- data/spec/cli/create_cli_spec.rb +10 -10
- data/spec/cli/debug_cli_spec.rb +4 -4
- data/spec/cli/destroy_cli_spec.rb +14 -14
- data/spec/cli/destroy_image_cli_spec.rb +8 -8
- data/spec/cli/droplets_cli_spec.rb +13 -13
- data/spec/cli/env_variable_spec.rb +2 -2
- data/spec/cli/halt_cli_spec.rb +15 -15
- data/spec/cli/images_cli_spec.rb +6 -6
- data/spec/cli/info_cli_spec.rb +32 -32
- data/spec/cli/info_image_cli_spec.rb +13 -13
- data/spec/cli/keys_cli_spec.rb +1 -1
- data/spec/cli/password_reset_cli_spec.rb +13 -13
- data/spec/cli/rebuild_cli_spec.rb +48 -48
- data/spec/cli/regions_cli_spec.rb +3 -3
- data/spec/cli/resize_cli_spec.rb +12 -12
- data/spec/cli/restart_cli_spec.rb +12 -12
- data/spec/cli/sizes_cli_spec.rb +2 -2
- data/spec/cli/snapshot_cli_spec.rb +11 -11
- data/spec/cli/ssh_cli_spec.rb +6 -6
- data/spec/cli/start_cli_spec.rb +11 -11
- data/spec/cli/verify_cli_spec.rb +3 -3
- data/spec/cli/wait_cli_spec.rb +11 -11
- data/spec/middleware/check_credentials_spec.rb +1 -1
- data/spec/middleware/inject_client_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -0
- data/tugboat.gemspec +3 -1
- metadata +34 -6
data/spec/cli/keys_cli_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe Tugboat::CLI do
|
|
6
6
|
describe 'keys' do
|
7
7
|
it 'shows a list' do
|
8
8
|
stub_request(:get, 'https://api.digitalocean.com/v2/account/keys?per_page=200').
|
9
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
9
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
10
10
|
to_return(status: 200, body: fixture('show_keys'), headers: {})
|
11
11
|
|
12
12
|
cli.keys
|
@@ -6,16 +6,16 @@ describe Tugboat::CLI do
|
|
6
6
|
describe 'passwordreset' do
|
7
7
|
it 'resets the root password given a fuzzy name' do
|
8
8
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
9
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
9
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
10
10
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
11
11
|
|
12
12
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
13
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
13
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
14
14
|
to_return(status: 200, body: fixture('show_droplets'), headers: { 'Content-Type' => 'application/json' })
|
15
15
|
|
16
16
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
17
17
|
with(body: '{"type":"password_reset"}',
|
18
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
18
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
19
19
|
to_return(status: 200, body: fixture('password_reset_response'), headers: {})
|
20
20
|
|
21
21
|
cli.password_reset('example.com')
|
@@ -29,20 +29,20 @@ Your new root password will be emailed to you
|
|
29
29
|
|
30
30
|
it 'resets the root password given an id' do
|
31
31
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
32
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
32
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
33
33
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
34
34
|
|
35
35
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
36
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
36
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
37
37
|
to_return(status: 200, body: fixture('show_droplets'), headers: { 'Content-Type' => 'application/json' })
|
38
38
|
|
39
39
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets/6918990?per_page=200').
|
40
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
40
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
41
41
|
to_return(status: 200, body: fixture('show_droplet'), headers: {})
|
42
42
|
|
43
43
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
44
44
|
with(body: '{"type":"password_reset"}',
|
45
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
45
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
46
46
|
to_return(status: 200, body: fixture('password_reset_response'), headers: {})
|
47
47
|
|
48
48
|
cli.options = cli.options.merge(id: 6_918_990)
|
@@ -57,16 +57,16 @@ Your new root password will be emailed to you
|
|
57
57
|
|
58
58
|
it 'resets the root password given a name' do
|
59
59
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
60
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
60
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
61
61
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
62
62
|
|
63
63
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
64
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
64
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
65
65
|
to_return(status: 200, body: fixture('show_droplets'), headers: { 'Content-Type' => 'application/json' })
|
66
66
|
|
67
67
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
68
68
|
with(body: '{"type":"password_reset"}',
|
69
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
69
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
70
70
|
to_return(status: 200, body: fixture('password_reset_response'), headers: {})
|
71
71
|
|
72
72
|
cli.options = cli.options.merge(name: 'example.com')
|
@@ -81,16 +81,16 @@ Your new root password will be emailed to you
|
|
81
81
|
|
82
82
|
it 'raises SystemExit when a request fails' do
|
83
83
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
84
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
84
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
85
85
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
86
86
|
|
87
87
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
88
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
88
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
89
89
|
to_return(status: 200, body: fixture('show_droplets'), headers: { 'Content-Type' => 'application/json' })
|
90
90
|
|
91
91
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
92
92
|
with(body: '{"type":"password_reset"}',
|
93
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
93
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
94
94
|
to_return(headers: { 'Content-Type' => 'application/json' }, status: 500, body: '{"status":"ERROR","message":"Some error"}')
|
95
95
|
|
96
96
|
cli.options = cli.options.merge(name: 'example.com')
|
@@ -6,20 +6,20 @@ describe Tugboat::CLI do
|
|
6
6
|
describe 'rebuild' do
|
7
7
|
it 'rebuilds a droplet with a fuzzy name based on an image with a fuzzy name' do
|
8
8
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
9
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
9
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
10
10
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
11
11
|
|
12
12
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
13
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
13
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
14
14
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
15
15
|
|
16
16
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
17
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
17
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
18
18
|
to_return(status: 200, body: fixture('show_images'), headers: {})
|
19
19
|
|
20
20
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
21
21
|
with(body: '{"type":"rebuild","image":12790328}',
|
22
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
22
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
23
23
|
to_return(status: 200, body: '', headers: {})
|
24
24
|
|
25
25
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -35,20 +35,20 @@ Warning! Potentially destructive action. Please confirm [y/n]: Queuing rebuild f
|
|
35
35
|
|
36
36
|
it 'rebuilds a droplet with an id based on an image with a fuzzy name' do
|
37
37
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
38
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
38
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
39
39
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
40
40
|
|
41
41
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets/12790328?per_page=200').
|
42
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
42
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
43
43
|
to_return(status: 200, body: fixture('show_droplet'), headers: {})
|
44
44
|
|
45
45
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
46
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
46
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
47
47
|
to_return(status: 200, body: fixture('show_images'), headers: {})
|
48
48
|
|
49
49
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
50
50
|
with(body: '{"type":"rebuild","image":12790328}',
|
51
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
51
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
52
52
|
to_return(status: 200, body: '', headers: {})
|
53
53
|
|
54
54
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -65,24 +65,24 @@ Warning! Potentially destructive action. Please confirm [y/n]: Queuing rebuild f
|
|
65
65
|
|
66
66
|
it 'rebuilds a droplet with a name based on an image with a fuzzy name' do
|
67
67
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
68
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
68
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
69
69
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
70
70
|
|
71
71
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
72
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
72
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
73
73
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
74
74
|
|
75
75
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets/12790328?per_page=200').
|
76
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
76
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
77
77
|
to_return(status: 200, body: fixture('show_droplet'), headers: {})
|
78
78
|
|
79
79
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
80
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
80
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
81
81
|
to_return(status: 200, body: fixture('show_images'), headers: {})
|
82
82
|
|
83
83
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
84
84
|
with(body: '{"type":"rebuild","image":12790328}',
|
85
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
85
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
86
86
|
to_return(status: 200, body: '', headers: {})
|
87
87
|
|
88
88
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -99,28 +99,28 @@ Warning! Potentially destructive action. Please confirm [y/n]: Queuing rebuild f
|
|
99
99
|
|
100
100
|
it 'rebuilds a droplet with a fuzzy name based on an image with an id' do
|
101
101
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
102
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
102
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
103
103
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
104
104
|
|
105
105
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
106
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
106
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
107
107
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
108
108
|
|
109
109
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets/12790328?per_page=200').
|
110
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
110
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
111
111
|
to_return(status: 200, body: fixture('show_droplet'), headers: {})
|
112
112
|
|
113
113
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
114
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
114
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
115
115
|
to_return(status: 200, body: fixture('show_images'), headers: {})
|
116
116
|
|
117
117
|
stub_request(:get, 'https://api.digitalocean.com/v2/images/12790328?per_page=200').
|
118
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
118
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
119
119
|
to_return(status: 200, body: fixture('show_image'), headers: {})
|
120
120
|
|
121
121
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
122
122
|
with(body: '{"type":"rebuild","image":6376601}',
|
123
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
123
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
124
124
|
to_return(status: 200, body: '', headers: {})
|
125
125
|
|
126
126
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -137,28 +137,28 @@ Warning! Potentially destructive action. Please confirm [y/n]: Queuing rebuild f
|
|
137
137
|
|
138
138
|
it 'rebuilds a droplet with an id based on an image with an id' do
|
139
139
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
140
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
140
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
141
141
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
142
142
|
|
143
143
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
144
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
144
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
145
145
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
146
146
|
|
147
147
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets/12790328?per_page=200').
|
148
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
148
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
149
149
|
to_return(status: 200, body: fixture('show_droplet'), headers: {})
|
150
150
|
|
151
151
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
152
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
152
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
153
153
|
to_return(status: 200, body: fixture('show_images'), headers: {})
|
154
154
|
|
155
155
|
stub_request(:get, 'https://api.digitalocean.com/v2/images/12790328?per_page=200').
|
156
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
156
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
157
157
|
to_return(status: 200, body: fixture('show_image'), headers: {})
|
158
158
|
|
159
159
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
160
160
|
with(body: '{"type":"rebuild","image":6376601}',
|
161
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
161
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
162
162
|
to_return(status: 200, body: '', headers: {})
|
163
163
|
|
164
164
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -175,28 +175,28 @@ Warning! Potentially destructive action. Please confirm [y/n]: Queuing rebuild f
|
|
175
175
|
|
176
176
|
it 'rebuilds a droplet with a name based on an image with an id' do
|
177
177
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
178
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
178
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
179
179
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
180
180
|
|
181
181
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
182
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
182
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
183
183
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
184
184
|
|
185
185
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets/12790328?per_page=200').
|
186
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
186
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
187
187
|
to_return(status: 200, body: fixture('show_droplet'), headers: {})
|
188
188
|
|
189
189
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
190
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
190
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
191
191
|
to_return(status: 200, body: fixture('show_images'), headers: {})
|
192
192
|
|
193
193
|
stub_request(:get, 'https://api.digitalocean.com/v2/images/12790328?per_page=200').
|
194
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
194
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
195
195
|
to_return(status: 200, body: fixture('show_image'), headers: {})
|
196
196
|
|
197
197
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
198
198
|
with(body: '{"type":"rebuild","image":6376601}',
|
199
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
199
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
200
200
|
to_return(status: 200, body: '', headers: {})
|
201
201
|
|
202
202
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -213,20 +213,20 @@ Warning! Potentially destructive action. Please confirm [y/n]: Queuing rebuild f
|
|
213
213
|
|
214
214
|
it 'rebuilds a droplet with a fuzzy name based on an image with a name' do
|
215
215
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
216
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
216
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
217
217
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
218
218
|
|
219
219
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
220
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
220
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
221
221
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
222
222
|
|
223
223
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
224
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
224
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
225
225
|
to_return(status: 200, body: fixture('show_images'), headers: {})
|
226
226
|
|
227
227
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
228
228
|
with(body: '{"type":"rebuild","image":12790328}',
|
229
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
229
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
230
230
|
to_return(status: 200, body: '', headers: {})
|
231
231
|
|
232
232
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -244,24 +244,24 @@ Warning! Potentially destructive action. Please confirm [y/n]: Queuing rebuild f
|
|
244
244
|
|
245
245
|
it 'rebuilds a droplet with an id based on an image with a name' do
|
246
246
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
247
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
247
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
248
248
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
249
249
|
|
250
250
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
251
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
251
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
252
252
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
253
253
|
|
254
254
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets/12790328?per_page=200').
|
255
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
255
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
256
256
|
to_return(status: 200, body: fixture('show_droplet'), headers: {})
|
257
257
|
|
258
258
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
259
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
259
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
260
260
|
to_return(status: 200, body: fixture('show_images'), headers: {})
|
261
261
|
|
262
262
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
263
263
|
with(body: '{"type":"rebuild","image":12790328}',
|
264
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
264
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
265
265
|
to_return(status: 200, body: '', headers: {})
|
266
266
|
|
267
267
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -278,20 +278,20 @@ Warning! Potentially destructive action. Please confirm [y/n]: Queuing rebuild f
|
|
278
278
|
|
279
279
|
it 'rebuilds a droplet with a name based on an image with a name' do
|
280
280
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
281
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
281
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
282
282
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
283
283
|
|
284
284
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
285
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
285
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
286
286
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
287
287
|
|
288
288
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
289
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
289
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
290
290
|
to_return(status: 200, body: fixture('show_images'), headers: {})
|
291
291
|
|
292
292
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
293
293
|
with(body: '{"type":"rebuild","image":12790328}',
|
294
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
294
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
295
295
|
to_return(status: 200, body: '', headers: {})
|
296
296
|
|
297
297
|
expect($stdin).to receive(:gets).and_return('y')
|
@@ -308,20 +308,20 @@ Warning! Potentially destructive action. Please confirm [y/n]: Queuing rebuild f
|
|
308
308
|
|
309
309
|
it 'rebuilds a droplet with confirm flag set' do
|
310
310
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
311
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
311
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
312
312
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
313
313
|
|
314
314
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
315
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
315
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
316
316
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
317
317
|
|
318
318
|
stub_request(:get, 'https://api.digitalocean.com/v2/images?per_page=200').
|
319
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
319
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
320
320
|
to_return(status: 200, body: fixture('show_images'), headers: {})
|
321
321
|
|
322
322
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
323
323
|
with(body: '{"type":"rebuild","image":12790328}',
|
324
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
324
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
325
325
|
to_return(status: 200, body: '', headers: {})
|
326
326
|
|
327
327
|
cli.options = cli.options.merge(confirm: 'no')
|
@@ -5,8 +5,8 @@ describe Tugboat::CLI do
|
|
5
5
|
|
6
6
|
describe 'regions' do
|
7
7
|
it 'shows a list' do
|
8
|
-
stub_request(:get, 'https://api.digitalocean.com/v2/regions?per_page=
|
9
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
8
|
+
stub_request(:get, 'https://api.digitalocean.com/v2/regions?page=1&per_page=20').
|
9
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
10
10
|
to_return(status: 200, body: fixture('show_regions'), headers: { 'Content-Type' => 'application/json' })
|
11
11
|
|
12
12
|
cli.regions
|
@@ -24,7 +24,7 @@ San Francisco 1 (slug: sfo1)
|
|
24
24
|
Singapore 1 (slug: sgp1)
|
25
25
|
eos
|
26
26
|
|
27
|
-
expect(a_request(:get, 'https://api.digitalocean.com/v2/regions?per_page=
|
27
|
+
expect(a_request(:get, 'https://api.digitalocean.com/v2/regions?page=1&per_page=20')).
|
28
28
|
to have_been_made
|
29
29
|
end
|
30
30
|
end
|
data/spec/cli/resize_cli_spec.rb
CHANGED
@@ -6,16 +6,16 @@ describe Tugboat::CLI do
|
|
6
6
|
describe 'resize' do
|
7
7
|
it 'resizes a droplet with a fuzzy name' do
|
8
8
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
9
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
9
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
10
10
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
11
11
|
|
12
12
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
13
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
13
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
14
14
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
15
15
|
|
16
16
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
17
17
|
with(body: '{"type":"resize","size":"1gb"}',
|
18
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
18
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
19
19
|
to_return(status: 200, body: fixture('resize_droplet'), headers: {})
|
20
20
|
|
21
21
|
cli.options = cli.options.merge(size: '1gb')
|
@@ -29,16 +29,16 @@ Queuing resize for 6918990 (example.com)...Resize complete!
|
|
29
29
|
|
30
30
|
it 'resizes a droplet with an id' do
|
31
31
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
32
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
32
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
33
33
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
34
34
|
|
35
35
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets/6918990?per_page=200').
|
36
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
36
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
37
37
|
to_return(status: 200, body: fixture('show_droplet'), headers: {})
|
38
38
|
|
39
39
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
40
40
|
with(body: '{"type":"resize","size":"1gb"}',
|
41
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
41
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
42
42
|
to_return(status: 200, body: fixture('resize_droplet'), headers: {})
|
43
43
|
|
44
44
|
cli.options = cli.options.merge(size: '1gb', id: 6_918_990)
|
@@ -52,16 +52,16 @@ Queuing resize for 6918990 (example.com)...Resize complete!
|
|
52
52
|
|
53
53
|
it 'resizes a droplet with a name' do
|
54
54
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
55
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
55
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
56
56
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
57
57
|
|
58
58
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
59
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
59
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
60
60
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
61
61
|
|
62
62
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
63
63
|
with(body: '{"type":"resize","size":"1gb"}',
|
64
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
64
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
65
65
|
to_return(status: 200, body: fixture('resize_droplet'), headers: {})
|
66
66
|
|
67
67
|
cli.options = cli.options.merge(size: '1gb', name: 'example.com')
|
@@ -75,16 +75,16 @@ Queuing resize for 6918990 (example.com)...Resize complete!
|
|
75
75
|
|
76
76
|
it 'raises SystemExit when a request fails' do
|
77
77
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=1').
|
78
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
78
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
79
79
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
80
80
|
|
81
81
|
stub_request(:get, 'https://api.digitalocean.com/v2/droplets?page=1&per_page=200').
|
82
|
-
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
82
|
+
with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
83
83
|
to_return(status: 200, body: fixture('show_droplets'), headers: {})
|
84
84
|
|
85
85
|
stub_request(:post, 'https://api.digitalocean.com/v2/droplets/6918990/actions').
|
86
86
|
with(body: '{"type":"resize","size":"1gb"}',
|
87
|
-
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.
|
87
|
+
headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer foo', 'Content-Type' => 'application/json', 'User-Agent' => 'Faraday v0.9.2' }).
|
88
88
|
to_return(headers: { 'Content-Type' => 'application/json' }, status: 500, body: '{"status":"ERROR","message":"Some error"}')
|
89
89
|
|
90
90
|
cli.options = cli.options.merge(size: '1gb')
|