vmc 0.5.0.rc4 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +68 -6
- data/lib/vmc/cli/start/target.rb +8 -1
- data/lib/vmc/version.rb +1 -1
- data/spec/features/v1/new_user_flow_spec.rb +0 -4
- data/spec/spec_helper.rb +2 -25
- data/spec/support/command_helper.rb +58 -10
- data/spec/support/fake_home_dir.rb +36 -23
- data/spec/vmc/cli/app/instances_spec.rb +7 -7
- data/spec/vmc/cli/app/scale_spec.rb +13 -18
- data/spec/vmc/cli/app/start_spec.rb +6 -39
- data/spec/vmc/cli/domain/map_spec.rb +27 -37
- data/spec/vmc/cli/domain/unmap_spec.rb +18 -22
- data/spec/vmc/cli/route/map_spec.rb +33 -31
- data/spec/vmc/cli/route/unmap_spec.rb +37 -31
- data/spec/vmc/cli/start/login_spec.rb +22 -37
- data/spec/vmc/cli/start/target_spec.rb +30 -4
- data/spec/vmc/cli/user/register_spec.rb +7 -15
- data/spec/vmc/cli_spec.rb +15 -17
- metadata +17 -34
data/spec/vmc/cli_spec.rb
CHANGED
@@ -4,6 +4,9 @@ describe VMC::CLI do
|
|
4
4
|
let(:context) { VMC::CLI.new }
|
5
5
|
let(:command) { nil }
|
6
6
|
|
7
|
+
let(:fake_home_dir) { nil }
|
8
|
+
stub_home_dir_with { fake_home_dir }
|
9
|
+
|
7
10
|
describe "#wrap_errors" do
|
8
11
|
let(:inputs) { {} }
|
9
12
|
|
@@ -250,7 +253,7 @@ describe VMC::CLI do
|
|
250
253
|
subject { context.client_target }
|
251
254
|
|
252
255
|
context "when a ~/.vmc/target exists" do
|
253
|
-
|
256
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/new" }
|
254
257
|
|
255
258
|
it "returns the target in that file" do
|
256
259
|
expect(subject).to eq "https://api.some-domain.com"
|
@@ -258,7 +261,7 @@ describe VMC::CLI do
|
|
258
261
|
end
|
259
262
|
|
260
263
|
context "when a ~/.vmc_target exists" do
|
261
|
-
|
264
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/old" }
|
262
265
|
|
263
266
|
it "returns the target in that file" do
|
264
267
|
expect(subject).to eq "https://api.some-domain.com"
|
@@ -266,7 +269,7 @@ describe VMC::CLI do
|
|
266
269
|
end
|
267
270
|
|
268
271
|
context "when no target file exists" do
|
269
|
-
|
272
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
|
270
273
|
|
271
274
|
it "returns nil" do
|
272
275
|
expect(subject).to eq nil
|
@@ -278,7 +281,7 @@ describe VMC::CLI do
|
|
278
281
|
subject { context.targets_info }
|
279
282
|
|
280
283
|
context "when a ~/.vmc/tokens.yml exists" do
|
281
|
-
|
284
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/new" }
|
282
285
|
|
283
286
|
it "returns the file's contents as a hash" do
|
284
287
|
expect(subject).to eq({
|
@@ -291,7 +294,7 @@ describe VMC::CLI do
|
|
291
294
|
end
|
292
295
|
|
293
296
|
context "when a ~/.vmc_token file exists" do
|
294
|
-
|
297
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/old" }
|
295
298
|
|
296
299
|
it "returns the target in that file" do
|
297
300
|
expect(subject).to eq({
|
@@ -303,7 +306,7 @@ describe VMC::CLI do
|
|
303
306
|
end
|
304
307
|
|
305
308
|
context "when no token file exists" do
|
306
|
-
|
309
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
|
307
310
|
|
308
311
|
it "returns an empty hash" do
|
309
312
|
expect(subject).to eq({})
|
@@ -315,7 +318,7 @@ describe VMC::CLI do
|
|
315
318
|
subject { VMC::CLI.new.target_info("https://api.some-domain.com") }
|
316
319
|
|
317
320
|
context "when a ~/.vmc/tokens.yml exists" do
|
318
|
-
|
321
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/new" }
|
319
322
|
|
320
323
|
it "returns the info for the given url" do
|
321
324
|
expect(subject).to eq({
|
@@ -326,7 +329,7 @@ describe VMC::CLI do
|
|
326
329
|
end
|
327
330
|
|
328
331
|
context "when a ~/.vmc_token file exists" do
|
329
|
-
|
332
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/old" }
|
330
333
|
|
331
334
|
it "returns the info for the given url" do
|
332
335
|
expect(subject).to eq({
|
@@ -336,7 +339,7 @@ describe VMC::CLI do
|
|
336
339
|
end
|
337
340
|
|
338
341
|
context "when no token file exists" do
|
339
|
-
|
342
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
|
340
343
|
|
341
344
|
it "returns an empty hash" do
|
342
345
|
expect(subject).to eq({})
|
@@ -345,9 +348,6 @@ describe VMC::CLI do
|
|
345
348
|
end
|
346
349
|
|
347
350
|
describe "methods that update the token info" do
|
348
|
-
let!(:tmpdir) { Dir.mktmpdir }
|
349
|
-
use_fake_home_dir { tmpdir }
|
350
|
-
|
351
351
|
before do
|
352
352
|
stub(context).targets_info do
|
353
353
|
{
|
@@ -357,8 +357,6 @@ describe VMC::CLI do
|
|
357
357
|
end
|
358
358
|
end
|
359
359
|
|
360
|
-
after { FileUtils.rm_rf tmpdir }
|
361
|
-
|
362
360
|
describe "#save_target_info" do
|
363
361
|
it "adds the given target info, and writes the result to ~/.vmc/tokens.yml" do
|
364
362
|
context.save_target_info({ :token => "bearer token3" }, "https://api.some-domain.com")
|
@@ -380,7 +378,8 @@ describe VMC::CLI do
|
|
380
378
|
end
|
381
379
|
|
382
380
|
describe "#client" do
|
383
|
-
|
381
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/new" }
|
382
|
+
|
384
383
|
before { stub(context).input { {} } }
|
385
384
|
|
386
385
|
describe "the client's token" do
|
@@ -397,13 +396,12 @@ describe VMC::CLI do
|
|
397
396
|
|
398
397
|
describe "the client's version" do
|
399
398
|
it "uses the version stored in the yml file" do
|
400
|
-
|
401
399
|
expect(context.client.version).to eq(2)
|
402
400
|
end
|
403
401
|
end
|
404
402
|
|
405
403
|
context "when there is no target" do
|
406
|
-
|
404
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
|
407
405
|
|
408
406
|
it "returns nil" do
|
409
407
|
expect(context.client).to eq(nil)
|
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vmc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 11
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
9
|
- 0
|
10
|
-
|
11
|
-
- 4
|
12
|
-
version: 0.5.0.rc4
|
10
|
+
version: 0.5.0
|
13
11
|
platform: ruby
|
14
12
|
authors:
|
15
13
|
- Cloud Foundry Team
|
@@ -18,7 +16,7 @@ autorequire:
|
|
18
16
|
bindir: bin
|
19
17
|
cert_chain: []
|
20
18
|
|
21
|
-
date: 2013-03-
|
19
|
+
date: 2013-03-05 00:00:00 Z
|
22
20
|
dependencies:
|
23
21
|
- !ruby/object:Gem::Dependency
|
24
22
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -69,23 +67,14 @@ dependencies:
|
|
69
67
|
version_requirements: &id004 !ruby/object:Gem::Requirement
|
70
68
|
none: false
|
71
69
|
requirements:
|
72
|
-
- -
|
70
|
+
- - ~>
|
73
71
|
- !ruby/object:Gem::Version
|
74
|
-
hash:
|
72
|
+
hash: 15
|
75
73
|
segments:
|
76
74
|
- 0
|
77
75
|
- 5
|
78
|
-
-
|
79
|
-
|
80
|
-
- 5
|
81
|
-
version: 0.5.1.rc5
|
82
|
-
- - <
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
hash: 7
|
85
|
-
segments:
|
86
|
-
- 0
|
87
|
-
- 6
|
88
|
-
version: "0.6"
|
76
|
+
- 2
|
77
|
+
version: 0.5.2
|
89
78
|
prerelease: false
|
90
79
|
type: :runtime
|
91
80
|
name: cfoundry
|
@@ -134,14 +123,12 @@ dependencies:
|
|
134
123
|
requirements:
|
135
124
|
- - ~>
|
136
125
|
- !ruby/object:Gem::Version
|
137
|
-
hash:
|
126
|
+
hash: 3
|
138
127
|
segments:
|
139
128
|
- 0
|
140
129
|
- 6
|
141
130
|
- 2
|
142
|
-
|
143
|
-
- 1
|
144
|
-
version: 0.6.2.rc1
|
131
|
+
version: 0.6.2
|
145
132
|
prerelease: false
|
146
133
|
type: :runtime
|
147
134
|
name: manifests-vmc-plugin
|
@@ -152,14 +139,12 @@ dependencies:
|
|
152
139
|
requirements:
|
153
140
|
- - ~>
|
154
141
|
- !ruby/object:Gem::Version
|
155
|
-
hash:
|
142
|
+
hash: 19
|
156
143
|
segments:
|
157
144
|
- 0
|
158
145
|
- 2
|
159
|
-
-
|
160
|
-
|
161
|
-
- 3
|
162
|
-
version: 0.2.1.rc3
|
146
|
+
- 2
|
147
|
+
version: 0.2.2
|
163
148
|
prerelease: false
|
164
149
|
type: :runtime
|
165
150
|
name: tunnel-vmc-plugin
|
@@ -389,14 +374,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
389
374
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
390
375
|
none: false
|
391
376
|
requirements:
|
392
|
-
- - "
|
377
|
+
- - ">="
|
393
378
|
- !ruby/object:Gem::Version
|
394
|
-
hash:
|
379
|
+
hash: 3
|
395
380
|
segments:
|
396
|
-
-
|
397
|
-
|
398
|
-
- 1
|
399
|
-
version: 1.3.1
|
381
|
+
- 0
|
382
|
+
version: "0"
|
400
383
|
requirements: []
|
401
384
|
|
402
385
|
rubyforge_project: vmc
|