pogo 2.32.14 → 2.39.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +0 -2
- data/lib/heroku/auth.rb +3 -1
- data/lib/heroku/client.rb +8 -5
- data/lib/heroku/client/cisaurus.rb +25 -0
- data/lib/heroku/client/heroku_postgresql.rb +0 -3
- data/lib/heroku/client/rendezvous.rb +2 -1
- data/lib/heroku/command.rb +1 -1
- data/lib/heroku/command/addons.rb +11 -2
- data/lib/heroku/command/apps.rb +105 -20
- data/lib/heroku/command/base.rb +1 -1
- data/lib/heroku/command/certs.rb +95 -34
- data/lib/heroku/command/config.rb +5 -5
- data/lib/heroku/command/domains.rb +4 -4
- data/lib/heroku/command/fork.rb +160 -0
- data/lib/heroku/command/git.rb +19 -20
- data/lib/heroku/command/help.rb +18 -2
- data/lib/heroku/command/keys.rb +1 -1
- data/lib/heroku/command/labs.rb +1 -1
- data/lib/heroku/command/logs.rb +3 -56
- data/lib/heroku/command/maintenance.rb +2 -2
- data/lib/heroku/command/pg.rb +7 -16
- data/lib/heroku/command/pgbackups.rb +37 -17
- data/lib/heroku/command/ps.rb +82 -35
- data/lib/heroku/command/regions.rb +23 -0
- data/lib/heroku/command/releases.rb +3 -3
- data/lib/heroku/command/run.rb +40 -27
- data/lib/heroku/command/sharing.rb +4 -4
- data/lib/heroku/command/ssl.rb +7 -25
- data/lib/heroku/command/stack.rb +1 -1
- data/lib/heroku/helpers/heroku_postgresql.rb +13 -17
- data/lib/heroku/helpers/log_displayer.rb +70 -0
- data/lib/heroku/plugin.rb +3 -0
- data/lib/heroku/updater.rb +11 -2
- data/lib/heroku/version.rb +1 -1
- data/spec/heroku/auth_spec.rb +10 -0
- data/spec/heroku/client/ssl_endpoint_spec.rb +12 -12
- data/spec/heroku/client_spec.rb +100 -100
- data/spec/heroku/command/addons_spec.rb +63 -59
- data/spec/heroku/command/apps_spec.rb +68 -65
- data/spec/heroku/command/base_spec.rb +21 -21
- data/spec/heroku/command/certs_spec.rb +31 -31
- data/spec/heroku/command/config_spec.rb +18 -18
- data/spec/heroku/command/db_spec.rb +3 -3
- data/spec/heroku/command/domains_spec.rb +13 -13
- data/spec/heroku/command/drains_spec.rb +3 -3
- data/spec/heroku/command/fork_spec.rb +56 -0
- data/spec/heroku/command/git_spec.rb +57 -29
- data/spec/heroku/command/labs_spec.rb +8 -8
- data/spec/heroku/command/logs_spec.rb +3 -3
- data/spec/heroku/command/maintenance_spec.rb +5 -5
- data/spec/heroku/command/pg_spec.rb +11 -25
- data/spec/heroku/command/pgbackups_spec.rb +13 -8
- data/spec/heroku/command/ps_spec.rb +23 -23
- data/spec/heroku/command/releases_spec.rb +22 -24
- data/spec/heroku/command/run_spec.rb +12 -15
- data/spec/heroku/command/sharing_spec.rb +9 -9
- data/spec/heroku/command/stack_spec.rb +4 -4
- data/spec/heroku/command_spec.rb +12 -12
- data/spec/heroku/helpers/heroku_postgresql_spec.rb +35 -14
- data/spec/spec_helper.rb +17 -2
- data/spec/support/openssl_mock_helper.rb +1 -1
- metadata +11 -6
- data/spec/heroku/command/ssl_spec.rb +0 -32
@@ -10,11 +10,11 @@ describe Heroku::Command::Ps do
|
|
10
10
|
context("cedar") do
|
11
11
|
|
12
12
|
before(:each) do
|
13
|
-
api.post_app("name" => "
|
13
|
+
api.post_app("name" => "example", "stack" => "cedar")
|
14
14
|
end
|
15
15
|
|
16
16
|
after(:each) do
|
17
|
-
api.delete_app("
|
17
|
+
api.delete_app("example")
|
18
18
|
end
|
19
19
|
|
20
20
|
it "ps:dynos errors out on cedar apps" do
|
@@ -29,11 +29,11 @@ describe Heroku::Command::Ps do
|
|
29
29
|
|
30
30
|
it "displays processes" do
|
31
31
|
Heroku::Command::Ps.any_instance.should_receive(:time_ago).exactly(10).times.and_return("2012/09/11 12:34:56 (~ 0s ago)")
|
32
|
-
api.post_ps_scale('
|
32
|
+
api.post_ps_scale('example', 'web', 10)
|
33
33
|
stderr, stdout = execute("ps")
|
34
34
|
stderr.should == ""
|
35
35
|
stdout.should == <<-STDOUT
|
36
|
-
=== web: `bundle exec thin start -p $PORT`
|
36
|
+
=== web (1X): `bundle exec thin start -p $PORT`
|
37
37
|
web.1: created 2012/09/11 12:34:56 (~ 0s ago)
|
38
38
|
web.2: created 2012/09/11 12:34:56 (~ 0s ago)
|
39
39
|
web.3: created 2012/09/11 12:34:56 (~ 0s ago)
|
@@ -50,15 +50,15 @@ STDOUT
|
|
50
50
|
|
51
51
|
it "displays one-off processes" do
|
52
52
|
Heroku::Command::Ps.any_instance.should_receive(:time_ago).and_return('2012/09/11 12:34:56 (~ 0s ago)', '2012/09/11 12:34:56 (~ 0s ago)')
|
53
|
-
api.post_ps "
|
53
|
+
api.post_ps "example", "bash"
|
54
54
|
|
55
55
|
stderr, stdout = execute("ps")
|
56
56
|
stderr.should == ""
|
57
57
|
stdout.should == <<-STDOUT
|
58
58
|
=== run: one-off processes
|
59
|
-
run.1: created 2012/09/11 12:34:56 (~ 0s ago): `bash`
|
59
|
+
run.1 (1X): created 2012/09/11 12:34:56 (~ 0s ago): `bash`
|
60
60
|
|
61
|
-
=== web: `bundle exec thin start -p $PORT`
|
61
|
+
=== web (1X): `bundle exec thin start -p $PORT`
|
62
62
|
web.1: created 2012/09/11 12:34:56 (~ 0s ago)
|
63
63
|
|
64
64
|
STDOUT
|
@@ -68,27 +68,27 @@ STDOUT
|
|
68
68
|
|
69
69
|
describe "ps:restart" do
|
70
70
|
|
71
|
-
it "restarts all
|
71
|
+
it "restarts all dynos with no args" do
|
72
72
|
stderr, stdout = execute("ps:restart")
|
73
73
|
stderr.should == ""
|
74
74
|
stdout.should == <<-STDOUT
|
75
|
-
Restarting
|
75
|
+
Restarting dynos... done
|
76
76
|
STDOUT
|
77
77
|
end
|
78
78
|
|
79
|
-
it "restarts one
|
79
|
+
it "restarts one dyno" do
|
80
80
|
stderr, stdout = execute("ps:restart web.1")
|
81
81
|
stderr.should == ""
|
82
82
|
stdout.should == <<-STDOUT
|
83
|
-
Restarting web.1
|
83
|
+
Restarting web.1 dyno... done
|
84
84
|
STDOUT
|
85
85
|
end
|
86
86
|
|
87
|
-
it "restarts a type of
|
87
|
+
it "restarts a type of dyno" do
|
88
88
|
stderr, stdout = execute("ps:restart web")
|
89
89
|
stderr.should == ""
|
90
90
|
stdout.should == <<-STDOUT
|
91
|
-
Restarting web
|
91
|
+
Restarting web dynos... done
|
92
92
|
STDOUT
|
93
93
|
end
|
94
94
|
|
@@ -100,7 +100,7 @@ STDOUT
|
|
100
100
|
stderr, stdout = execute("ps:scale web=5")
|
101
101
|
stderr.should == ""
|
102
102
|
stdout.should == <<-STDOUT
|
103
|
-
Scaling web
|
103
|
+
Scaling web dynos... done, now running 5
|
104
104
|
STDOUT
|
105
105
|
end
|
106
106
|
|
@@ -108,7 +108,7 @@ STDOUT
|
|
108
108
|
stderr, stdout = execute("ps:scale web+2")
|
109
109
|
stderr.should == ""
|
110
110
|
stdout.should == <<-STDOUT
|
111
|
-
Scaling web
|
111
|
+
Scaling web dynos... done, now running 3
|
112
112
|
STDOUT
|
113
113
|
end
|
114
114
|
|
@@ -116,19 +116,19 @@ STDOUT
|
|
116
116
|
|
117
117
|
describe "ps:stop" do
|
118
118
|
|
119
|
-
it "restarts one
|
119
|
+
it "restarts one dyno" do
|
120
120
|
stderr, stdout = execute("ps:restart ps.1")
|
121
121
|
stderr.should == ""
|
122
122
|
stdout.should == <<-STDOUT
|
123
|
-
Restarting ps.1
|
123
|
+
Restarting ps.1 dyno... done
|
124
124
|
STDOUT
|
125
125
|
end
|
126
126
|
|
127
|
-
it "restarts a type of
|
127
|
+
it "restarts a type of dyno" do
|
128
128
|
stderr, stdout = execute("ps:restart ps")
|
129
129
|
stderr.should == ""
|
130
130
|
stdout.should == <<-STDOUT
|
131
|
-
Restarting ps
|
131
|
+
Restarting ps dynos... done
|
132
132
|
STDOUT
|
133
133
|
end
|
134
134
|
|
@@ -139,11 +139,11 @@ STDOUT
|
|
139
139
|
context("non-cedar") do
|
140
140
|
|
141
141
|
before(:each) do
|
142
|
-
api.post_app("name" => "
|
142
|
+
api.post_app("name" => "example")
|
143
143
|
end
|
144
144
|
|
145
145
|
after(:each) do
|
146
|
-
api.delete_app("
|
146
|
+
api.delete_app("example")
|
147
147
|
end
|
148
148
|
|
149
149
|
describe "ps:dynos" do
|
@@ -153,7 +153,7 @@ STDOUT
|
|
153
153
|
stderr.should == ""
|
154
154
|
stdout.should == <<-STDOUT
|
155
155
|
~ `heroku ps:dynos QTY` has been deprecated and replaced with `heroku ps:scale dynos=QTY`
|
156
|
-
|
156
|
+
example is running 0 dynos
|
157
157
|
STDOUT
|
158
158
|
end
|
159
159
|
|
@@ -175,7 +175,7 @@ STDOUT
|
|
175
175
|
stderr.should == ""
|
176
176
|
stdout.should == <<-STDOUT
|
177
177
|
~ `heroku ps:workers QTY` has been deprecated and replaced with `heroku ps:scale workers=QTY`
|
178
|
-
|
178
|
+
example is running 0 workers
|
179
179
|
STDOUT
|
180
180
|
end
|
181
181
|
|
@@ -10,24 +10,24 @@ describe Heroku::Command::Releases do
|
|
10
10
|
describe "releases" do
|
11
11
|
|
12
12
|
before(:each) do
|
13
|
-
api.post_app("name" => "
|
14
|
-
api.put_config_vars("
|
15
|
-
api.put_config_vars("
|
16
|
-
api.put_config_vars("
|
17
|
-
api.put_config_vars("
|
18
|
-
api.put_config_vars("
|
13
|
+
api.post_app("name" => "example", "stack" => "cedar")
|
14
|
+
api.put_config_vars("example", { 'FOO_BAR' => 'BAZ' })
|
15
|
+
api.put_config_vars("example", { 'BAR_BAZ' => 'QUX' })
|
16
|
+
api.put_config_vars("example", { 'BAZ_QUX' => 'QUUX' })
|
17
|
+
api.put_config_vars("example", { 'QUX_QUUX' => 'XYZZY' })
|
18
|
+
api.put_config_vars("example", { 'SUPER_LONG_CONFIG_VAR_TO_GET_PAST_THE_TRUNCATION_LIMIT' => 'VALUE' })
|
19
19
|
Heroku::Command::Releases.any_instance.should_receive(:time_ago).exactly(5).times.and_return('2012/09/10 11:36:44 (~ 0s ago)', '2012/09/10 11:36:43 (~ 1s ago)', '2012/09/10 11:35:44 (~ 1m ago)', '2012/09/10 10:36:44 (~ 1h ago)', '2012/01/02 12:34:56')
|
20
20
|
end
|
21
21
|
|
22
22
|
after(:each) do
|
23
|
-
api.delete_app("
|
23
|
+
api.delete_app("example")
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should list releases" do
|
27
27
|
@stderr, @stdout = execute("releases")
|
28
28
|
@stderr.should == ""
|
29
29
|
@stdout.should == <<-STDOUT
|
30
|
-
===
|
30
|
+
=== example Releases
|
31
31
|
v5 Config add SUPER_LONG_CONFIG_VAR_TO_GE.. email@example.com 2012/09/10 11:36:44 (~ 0s ago)
|
32
32
|
v4 Config add QUX_QUUX email@example.com 2012/09/10 11:36:43 (~ 1s ago)
|
33
33
|
v3 Config add BAZ_QUX email@example.com 2012/09/10 11:35:44 (~ 1m ago)
|
@@ -41,12 +41,12 @@ STDOUT
|
|
41
41
|
|
42
42
|
describe "releases:info" do
|
43
43
|
before(:each) do
|
44
|
-
api.post_app("name" => "
|
45
|
-
api.put_config_vars("
|
44
|
+
api.post_app("name" => "example", "stack" => "cedar")
|
45
|
+
api.put_config_vars("example", { 'FOO_BAR' => 'BAZ' })
|
46
46
|
end
|
47
47
|
|
48
48
|
after(:each) do
|
49
|
-
api.delete_app("
|
49
|
+
api.delete_app("example")
|
50
50
|
end
|
51
51
|
|
52
52
|
it "requires a release to be specified" do
|
@@ -68,11 +68,10 @@ Change: Config add FOO_BAR
|
|
68
68
|
When: 2012/09/11 12:34:56 (~ 0s ago)
|
69
69
|
|
70
70
|
=== v1 Config Vars
|
71
|
-
BUNDLE_WITHOUT:
|
72
|
-
DATABASE_URL:
|
73
|
-
LANG:
|
74
|
-
RACK_ENV:
|
75
|
-
SHARED_DATABASE_URL: postgres://username:password@ec2-123-123-123-123.compute-1.amazonaws.com/username
|
71
|
+
BUNDLE_WITHOUT: development:test
|
72
|
+
DATABASE_URL: postgres://username:password@ec2-123-123-123-123.compute-1.amazonaws.com/username
|
73
|
+
LANG: en_US.UTF-8
|
74
|
+
RACK_ENV: production
|
76
75
|
STDOUT
|
77
76
|
end
|
78
77
|
|
@@ -91,28 +90,27 @@ BUNDLE_WITHOUT=development:test
|
|
91
90
|
DATABASE_URL=postgres://username:password@ec2-123-123-123-123.compute-1.amazonaws.com/username
|
92
91
|
LANG=en_US.UTF-8
|
93
92
|
RACK_ENV=production
|
94
|
-
SHARED_DATABASE_URL=postgres://username:password@ec2-123-123-123-123.compute-1.amazonaws.com/username
|
95
93
|
STDOUT
|
96
94
|
end
|
97
95
|
end
|
98
96
|
|
99
97
|
describe "rollback" do
|
100
98
|
before(:each) do
|
101
|
-
api.post_app("name" => "
|
102
|
-
api.put_config_vars("
|
103
|
-
api.put_config_vars("
|
104
|
-
api.put_config_vars("
|
99
|
+
api.post_app("name" => "example", "stack" => "cedar")
|
100
|
+
api.put_config_vars("example", { 'FOO_BAR' => 'BAZ' })
|
101
|
+
api.put_config_vars("example", { 'BAR_BAZ' => 'QUX' })
|
102
|
+
api.put_config_vars("example", { 'BAZ_QUX' => 'QUUX' })
|
105
103
|
end
|
106
104
|
|
107
105
|
after(:each) do
|
108
|
-
api.delete_app("
|
106
|
+
api.delete_app("example")
|
109
107
|
end
|
110
108
|
|
111
109
|
it "rolls back to the latest release with no argument" do
|
112
110
|
stderr, stdout = execute("releases:rollback")
|
113
111
|
stderr.should == ""
|
114
112
|
stdout.should == <<-STDOUT
|
115
|
-
Rolling back
|
113
|
+
Rolling back example... done, v2
|
116
114
|
STDOUT
|
117
115
|
end
|
118
116
|
|
@@ -120,7 +118,7 @@ STDOUT
|
|
120
118
|
stderr, stdout = execute("releases:rollback v1")
|
121
119
|
stderr.should == ""
|
122
120
|
stdout.should == <<-STDOUT
|
123
|
-
Rolling back
|
121
|
+
Rolling back example... done, v1
|
124
122
|
STDOUT
|
125
123
|
end
|
126
124
|
end
|
@@ -8,11 +8,11 @@ describe Heroku::Command::Run do
|
|
8
8
|
|
9
9
|
before(:each) do
|
10
10
|
stub_core
|
11
|
-
api.post_app("name" => "
|
11
|
+
api.post_app("name" => "example", "stack" => "cedar")
|
12
12
|
end
|
13
13
|
|
14
14
|
after(:each) do
|
15
|
-
api.delete_app("
|
15
|
+
api.delete_app("example")
|
16
16
|
end
|
17
17
|
|
18
18
|
describe "run" do
|
@@ -37,6 +37,14 @@ Running `bin/foo` detached... up, run.1
|
|
37
37
|
Use `heroku logs -p run.1` to view the output.
|
38
38
|
STDOUT
|
39
39
|
end
|
40
|
+
|
41
|
+
it "runs with options" do
|
42
|
+
stub_core.read_logs("example", [
|
43
|
+
"tail=1",
|
44
|
+
"ps=run.1"
|
45
|
+
])
|
46
|
+
execute "run:detached bin/foo --tail"
|
47
|
+
end
|
40
48
|
end
|
41
49
|
|
42
50
|
describe "run:rake" do
|
@@ -66,21 +74,10 @@ STDOUT
|
|
66
74
|
end
|
67
75
|
|
68
76
|
describe "run:console" do
|
69
|
-
it "
|
70
|
-
console = stub(Heroku::Client::ConsoleSession)
|
71
|
-
stub_core.console.returns(console)
|
77
|
+
it "has been removed" do
|
72
78
|
stderr, stdout = execute("run:console")
|
73
79
|
stderr.should == ""
|
74
|
-
stdout.should
|
75
|
-
end
|
76
|
-
|
77
|
-
it "runs a console command" do
|
78
|
-
stub_core.console("myapp", "bash foo").returns("foo_output")
|
79
|
-
stderr, stdout = execute("run:console bash foo")
|
80
|
-
stderr.should == ""
|
81
|
-
stdout.should == <<-STDOUT
|
82
|
-
foo_output
|
83
|
-
STDOUT
|
80
|
+
stdout.should =~ /has been removed/
|
84
81
|
end
|
85
82
|
end
|
86
83
|
end
|
@@ -6,21 +6,21 @@ module Heroku::Command
|
|
6
6
|
|
7
7
|
before(:each) do
|
8
8
|
stub_core
|
9
|
-
api.post_app("name" => "
|
9
|
+
api.post_app("name" => "example")
|
10
10
|
end
|
11
11
|
|
12
12
|
after(:each) do
|
13
|
-
api.delete_app("
|
13
|
+
api.delete_app("example")
|
14
14
|
end
|
15
15
|
|
16
16
|
context("list") do
|
17
17
|
|
18
18
|
it "lists collaborators" do
|
19
|
-
api.post_collaborator("
|
19
|
+
api.post_collaborator("example", "collaborator@example.com")
|
20
20
|
stderr, stdout = execute("sharing")
|
21
21
|
stderr.should == ""
|
22
22
|
stdout.should == <<-STDOUT
|
23
|
-
===
|
23
|
+
=== example Collaborators
|
24
24
|
collaborator@example.com
|
25
25
|
email@example.com
|
26
26
|
|
@@ -33,25 +33,25 @@ STDOUT
|
|
33
33
|
stderr, stdout = execute("sharing:add collaborator@example.com")
|
34
34
|
stderr.should == ""
|
35
35
|
stdout.should == <<-STDOUT
|
36
|
-
Adding collaborator@example.com to
|
36
|
+
Adding collaborator@example.com to example collaborators... done
|
37
37
|
STDOUT
|
38
38
|
end
|
39
39
|
|
40
40
|
it "removes collaborators" do
|
41
|
-
api.post_collaborator("
|
41
|
+
api.post_collaborator("example", "collaborator@example.com")
|
42
42
|
stderr, stdout = execute("sharing:remove collaborator@example.com")
|
43
43
|
stderr.should == ""
|
44
44
|
stdout.should == <<-STDOUT
|
45
|
-
Removing collaborator@example.com from
|
45
|
+
Removing collaborator@example.com from example collaborators... done
|
46
46
|
STDOUT
|
47
47
|
end
|
48
48
|
|
49
49
|
it "transfers ownership" do
|
50
|
-
api.post_collaborator("
|
50
|
+
api.post_collaborator("example", "collaborator@example.com")
|
51
51
|
stderr, stdout = execute("sharing:transfer collaborator@example.com")
|
52
52
|
stderr.should == ""
|
53
53
|
stdout.should == <<-STDOUT
|
54
|
-
Transferring
|
54
|
+
Transferring example to collaborator@example.com... done
|
55
55
|
STDOUT
|
56
56
|
end
|
57
57
|
end
|
@@ -6,18 +6,18 @@ module Heroku::Command
|
|
6
6
|
describe "index" do
|
7
7
|
before(:each) do
|
8
8
|
stub_core
|
9
|
-
api.post_app("name" => "
|
9
|
+
api.post_app("name" => "example", "stack" => "bamboo-mri-1.9.2")
|
10
10
|
end
|
11
11
|
|
12
12
|
after(:each) do
|
13
|
-
api.delete_app("
|
13
|
+
api.delete_app("example")
|
14
14
|
end
|
15
15
|
|
16
16
|
it "index should provide list" do
|
17
17
|
stderr, stdout = execute("stack")
|
18
18
|
stderr.should == ""
|
19
19
|
stdout.should == <<-STDOUT
|
20
|
-
===
|
20
|
+
=== example Available Stacks
|
21
21
|
aspen-mri-1.8.6
|
22
22
|
bamboo-ree-1.8.7
|
23
23
|
cedar (beta)
|
@@ -30,7 +30,7 @@ STDOUT
|
|
30
30
|
stderr, stdout = execute("stack:migrate bamboo-ree-1.8.7")
|
31
31
|
stderr.should == ""
|
32
32
|
stdout.should == <<-STDOUT
|
33
|
-
-----> Preparing to migrate
|
33
|
+
-----> Preparing to migrate example
|
34
34
|
bamboo-mri-1.9.2 -> bamboo-ree-1.8.7
|
35
35
|
|
36
36
|
NOTE: Additional details here
|
data/spec/heroku/command_spec.rb
CHANGED
@@ -51,13 +51,13 @@ describe Heroku::Command do
|
|
51
51
|
context "and the app is known" do
|
52
52
|
before do
|
53
53
|
any_instance_of(Heroku::Command::Base) do |base|
|
54
|
-
stub(base).app.returns("
|
54
|
+
stub(base).app.returns("example")
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
58
|
context "and the user includes --confirm WRONGAPP" do
|
59
59
|
it "should not allow include the option" do
|
60
|
-
stub_request(:post, %r{apps/
|
60
|
+
stub_request(:post, %r{apps/example/addons/my_addon$}).
|
61
61
|
with(:body => "")
|
62
62
|
run "addons:add my_addon --confirm XXX"
|
63
63
|
end
|
@@ -65,17 +65,17 @@ describe Heroku::Command do
|
|
65
65
|
|
66
66
|
context "and the user includes --confirm APP" do
|
67
67
|
it "should set --app to APP and not ask for confirmation" do
|
68
|
-
stub_request(:post, %r{apps/
|
69
|
-
with(:body => {:confirm => '
|
68
|
+
stub_request(:post, %r{apps/example/addons/my_addon$}).
|
69
|
+
with(:body => {:confirm => 'example'})
|
70
70
|
|
71
|
-
run "addons:add my_addon --confirm
|
71
|
+
run "addons:add my_addon --confirm example"
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
75
|
context "and the user didn't include a confirm flag" do
|
76
76
|
it "should ask the user for confirmation" do
|
77
77
|
stub(Heroku::Command).confirm_command.returns(true)
|
78
|
-
stub_request(:post, %r{apps/
|
78
|
+
stub_request(:post, %r{apps/example/addons/my_addon$}).
|
79
79
|
to_return(response_that_requires_confirmation).then.
|
80
80
|
to_return({:status => 200})
|
81
81
|
|
@@ -83,16 +83,16 @@ describe Heroku::Command do
|
|
83
83
|
end
|
84
84
|
|
85
85
|
it "should not continue if the confirmation does not match" do
|
86
|
-
Heroku::Command.stub(:current_options).and_return(:confirm => '
|
86
|
+
Heroku::Command.stub(:current_options).and_return(:confirm => 'not_example')
|
87
87
|
|
88
88
|
lambda do
|
89
|
-
Heroku::Command.confirm_command('
|
89
|
+
Heroku::Command.confirm_command('example')
|
90
90
|
end.should raise_error(Heroku::Command::CommandFailed)
|
91
91
|
end
|
92
92
|
|
93
93
|
it "should not continue if the user doesn't confirm" do
|
94
94
|
stub(Heroku::Command).confirm_command.returns(false)
|
95
|
-
stub_request(:post, %r{apps/
|
95
|
+
stub_request(:post, %r{apps/example/addons/my_addon$}).
|
96
96
|
to_return(response_that_requires_confirmation).then.
|
97
97
|
to_raise(Heroku::Command::CommandFailed)
|
98
98
|
|
@@ -157,12 +157,12 @@ describe Heroku::Command do
|
|
157
157
|
|
158
158
|
context "help" do
|
159
159
|
it "works as a prefix" do
|
160
|
-
heroku("help ps:scale").should =~ /scale
|
160
|
+
heroku("help ps:scale").should =~ /scale dynos by/
|
161
161
|
end
|
162
162
|
|
163
163
|
it "works as an option" do
|
164
|
-
heroku("ps:scale -h").should =~ /scale
|
165
|
-
heroku("ps:scale --help").should =~ /scale
|
164
|
+
heroku("ps:scale -h").should =~ /scale dynos by/
|
165
|
+
heroku("ps:scale --help").should =~ /scale dynos by/
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|